Adapt routingspeed.rkt to latest prospect API
This commit is contained in:
parent
2408ebe255
commit
3e611d190c
|
@ -5,15 +5,15 @@
|
||||||
(define N-PATTERNS 10000)
|
(define N-PATTERNS 10000)
|
||||||
(define N-MESSAGES 1000000)
|
(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
|
(define pats
|
||||||
(time
|
(time
|
||||||
(for/fold [(p (matcher-empty))]
|
(for/fold [(p (trie-empty))]
|
||||||
[(n (in-range N-PATTERNS))]
|
[(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)
|
||||||
(collect-garbage)
|
(collect-garbage)
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(for [(j (in-range N-MESSAGES))]
|
(for [(j (in-range N-MESSAGES))]
|
||||||
(define i (random N-PATTERNS))
|
(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"
|
(printf "Delta ~a ms; that is, ~a microsec per routed message, ~a Hz\n"
|
||||||
|
|
Loading…
Reference in New Issue