adjust datum-intern stress test
Instead of requiring a table not to grow within an iteration, require it to not grow across iterations.
This commit is contained in:
parent
0938ae8e33
commit
3cc74bd3db
|
@ -1,19 +1,25 @@
|
|||
#lang racket/base
|
||||
|
||||
(define (check label mk)
|
||||
(let loop ([tries 0])
|
||||
(printf "~a ~a\n" label tries)
|
||||
(collect-garbage)
|
||||
(define pre (current-memory-use))
|
||||
(collect-garbage)
|
||||
(define pre (current-memory-use))
|
||||
(let loop ([tries 0] [pre pre])
|
||||
(printf "~a ~a @ ~s\n" label tries pre)
|
||||
(for ([j 100])
|
||||
(for ([i (in-range 10000)])
|
||||
(datum-intern-literal (mk i j))))
|
||||
(collect-garbage)
|
||||
(when ((current-memory-use) . > . pre)
|
||||
(when (= tries 10)
|
||||
(define post (current-memory-use))
|
||||
(when (post . > . pre)
|
||||
(when (= tries 20)
|
||||
(error 'check "didn't find non-growing iteration"))
|
||||
(loop (add1 tries)))))
|
||||
(loop (add1 tries) post))))
|
||||
|
||||
(pseudo-random-generator->vector (current-pseudo-random-generator))
|
||||
(check "strings" (lambda (i j) (format "string-~a-~a" i j)))
|
||||
(check "flonums" (lambda (i j) (random)))
|
||||
|
||||
|
||||
(module+ test
|
||||
(module config info
|
||||
(define random? #t)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user