Skip to content

Commit 29e997e

Browse files
committed
Avoid sub-millisecond measurements
1 parent 39f3d4f commit 29e997e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

dev/simple_stress_test.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@
4747
fr-handlers (when convert-list? custom-read-handlers)]
4848
(a/info (merge {:event :starting-stress-test} argmap))
4949
(let [work-chan (async/chan 1)
50-
timeout-chan (async/timeout (* 1000 60 20))]
50+
timeout-chan (async/timeout (* 1000 60 20))
51+
; avoid submillisecond measurement
52+
struct-count (* 1000 (if (< struct-size 9)
53+
100 1))]
5154
(loop [runs 0
5255
proc-time 0]
53-
(let [structs (repeatedly 1000 #(gen-struct-fn struct-size))
56+
(let [structs (repeatedly struct-count #(gen-struct-fn struct-size))
5457
; put generated structs fressianed into the work channel as a single coll
5558
_ (async/put! work-chan (into [] (for [st structs] (fressian st))))
5659
[val port] (async/alts!! [work-chan timeout-chan])]

0 commit comments

Comments
 (0)