syndicate-rkt/syndicate/test/speed/speed-message-sending.rkt

17 lines
521 B
Racket

#lang imperative-syndicate/test-implementation
;; Rough message send speed test
(let ((N 100000))
(test-case
[(spawn (on (message $v)
(if (= v N)
(stop-current-facet)
(send! (+ v 1))))
(on-start (send! 0)))]
no-crashes
(it "should be fairly quick"
(log-info "Rough message send speed: ~a msgs in ~a ms = ~a Hz"
N
(test-run-time)
(/ N (/ (test-run-time) 1000.0))))))