1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-26 14:22:25 +03:00

perf: fix perf3 to show total iters instead of / 3

The run-fn-for function was originally name run-fn and was hard-coded
to run for 3 seconds. I forgot to replace the 3 with the max-secs
variable. However, given that some implementations have less than
1 iteration per second, I'm just going to drop that division and
report the iterations per max-seconds so that for the slowest
implementations we have some relative comparison instead of all of
them just reporting 0.

Thanks to Tim Morgan for discovering this bug:
699f0ad23a
This commit is contained in:
Joel Martin 2018-07-16 09:34:37 -05:00
parent cd30e52b31
commit 6da59ec2f4
2 changed files with 2 additions and 2 deletions

View File

@ -24,4 +24,4 @@
;; Warm it up first
(run-fn-for* fn 1000 0 0)
;; Now do the test
(/ (run-fn-for* fn (* 1000 max-secs) 0 0) 3))))
(run-fn-for* fn (* 1000 max-secs) 0 0))))

View File

@ -5,7 +5,7 @@
(def! atm (atom (list 0 1 2 3 4 5 6 7 8 9)))
(println "iters/s:"
(println "iters over 10 seconds:"
(run-fn-for
(fn* []
(do