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

20 lines
639 B
Racket

; SPDX-License-Identifier: LGPL-3.0-or-later
; SPDX-FileCopyrightText: 2010-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
#lang 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))))))