From e7d3811b7771b5bfd2fcbb047c66424aaf4372be Mon Sep 17 00:00:00 2001 From: Christopher Lemmer Webber Date: Tue, 15 Oct 2019 15:13:07 -0400 Subject: [PATCH] Update perf-tests to new spawn interface --- misc/perf-tests.rkt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/misc/perf-tests.rkt b/misc/perf-tests.rkt index 4911e80..70c994f 100644 --- a/misc/perf-tests.rkt +++ b/misc/perf-tests.rkt @@ -4,7 +4,7 @@ racket/match) (define (do-actors-gc [actormap (make-whactormap)]) - (define (simple-actor bcom) + (define ((simple-actor bcom)) 'hello) (time (actormap-run! @@ -18,7 +18,7 @@ ;; (collect-garbage 'major) (define (do-self-referential-actors-gc [actormap (make-whactormap)]) - (define (make-simple-actor bcom) + (define (^simple-actor bcom) (define self (match-lambda* [(list 'self) self] @@ -30,18 +30,18 @@ (lambda () (for ([i 1000000]) (define friend - (spawn (make-simple-actor))) + (spawn ^simple-actor)) (call friend 'oop)))))) (define (call-a-lot [actormap (make-whactormap)]) - (define (simple-actor bcom) + (define ((^simple-actor bcom)) 'hello) (time (actormap-run! actormap (lambda () (define friend - (spawn simple-actor)) + (spawn ^simple-actor)) (for ([i 1000000]) (call friend)))))) @@ -49,11 +49,12 @@ (define (bcom-a-lot [actormap (make-whactormap)] #:num-actors [num-actors 1000] #:iterations [iterations 1000]) - (define ((incrementing-actor [i 0]) bcom) - (bcom (incrementing-actor (add1 i)) i)) + (define ((^incrementing-actor bcom [i 0])) + (values (bcom ^incrementing-actor (add1 i)) + i)) (define i-as (for/list ([i num-actors]) - (actormap-spawn! actormap (incrementing-actor)))) + (actormap-spawn! actormap ^incrementing-actor))) (time (for ([_ iterations]) (actormap-run! @@ -61,3 +62,4 @@ (lambda () (for ([i-a i-as]) (i-a))))))) +