Adapt routingspeed.rkt to latest prospect API

This commit is contained in:
Tony Garnock-Jones 2016-03-02 06:28:50 -05:00
parent 2408ebe255
commit 3e611d190c
1 changed files with 5 additions and 5 deletions

View File

@ -5,15 +5,15 @@
(define N-PATTERNS 10000)
(define N-MESSAGES 1000000)
(define (pat n) (pattern->matcher (datum-tset n) (list n ?)))
(define (pat n) (pattern->trie (datum-tset n) (list n ?)))
(define pats
(time
(for/fold [(p (matcher-empty))]
(for/fold [(p (trie-empty))]
[(n (in-range N-PATTERNS))]
(matcher-union p (pat n)))))
(trie-union p (pat n)))))
;; (display (matcher->dot pats))
;; (display (trie->dot pats))
(collect-garbage)
(collect-garbage)
@ -24,7 +24,7 @@
(lambda ()
(for [(j (in-range N-MESSAGES))]
(define i (random N-PATTERNS))
(matcher-match-value pats (list i i) #f)))
(trie-lookup pats (list i i) #f)))
'()))
(printf "Delta ~a ms; that is, ~a microsec per routed message, ~a Hz\n"