redex: memoize only the non-terminal patterns
remarkably, this seems to cut the time for running the r6rs test suite in about 1/2
This commit is contained in:
parent
57f51cf5c8
commit
4c86e2fe86
|
@ -686,7 +686,10 @@ See match-a-pattern.rkt for more details
|
||||||
[(eq? compiled-cache uniq)
|
[(eq? compiled-cache uniq)
|
||||||
(let-values ([(compiled-pattern has-hole?)
|
(let-values ([(compiled-pattern has-hole?)
|
||||||
(true-compile-pattern pattern)])
|
(true-compile-pattern pattern)])
|
||||||
(let ([val (list (memoize compiled-pattern has-hole?)
|
(let ([val (list (match pattern
|
||||||
|
[`(nt ,p)
|
||||||
|
(memoize compiled-pattern has-hole?)]
|
||||||
|
[_ compiled-pattern])
|
||||||
has-hole?)])
|
has-hole?)])
|
||||||
(hash-set! compiled-pattern-cache pattern val)
|
(hash-set! compiled-pattern-cache pattern val)
|
||||||
(apply values val)))]
|
(apply values val)))]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user