refine test of compilation time

Relevant to #2977
This commit is contained in:
Matthew Flatt 2019-12-18 06:46:02 -07:00
parent a135a868a8
commit b1d9201c13

View File

@ -6206,6 +6206,7 @@
(cons (gensym) (loop (sub1 i))))))
(define (time-it n)
(collect-garbage)
(let ([start (current-process-milliseconds)])
(let* ([args (gensym-n n)]
[defns (gensym-n n)])
@ -6215,9 +6216,10 @@
,@(map (lambda (arg defn) `(,arg ,defn)) args defns))))
(- (current-process-milliseconds) start)))
(let loop ([tries 3])
(let loop ([tries 10])
(let ([a (time-it 100)]
[b (time-it 1000)])
(printf "~s ~s\n" a b)
;; n lg(n) is ok, n^2 is not
(when (b . > . (* 50 a))
(if (zero? tries)