be a frame and react to changes in focus of the main drracket window.
didn't finish because there does not seem to be an equivalent to
on-subwindow-focus that lets the frame detect when one of its
children gets the focus.
related to PR 12474
There is a big comment in thread.rkt that explains the problem and the
"fix". I think something better could and should be done, but I don't
know what it is.
This speeds up the lambdajs model considerably because the computation
to determine duplicates is expensive and no duplicates are really
ever dropped (and, in general, I think that duplicates will only
be dropped when the grammar is ambiguous; so maybe a better thing
is to just rewrite the grammar when that happens)
when one hole has been found
This improves the lambdajs model example's running time, presumably
because the hole is generally found near the "beginning" of the
term
Instead of using a hash-table, use the equal-hash-code directly;
this lets me evict entries only when they clobber each other,
and generally keep good cache utilization.
Also, cut the cache size by a factor of 5 while still having a
slight performance improvement on the r6rs test suite benchmark.
On that same benchmark, there are 1714812 misses in the cache, but
only 3485 times is an entry in the cache clobbered
have any holes, hide-holes, or names and, in that case, just
combining booleans instead of building of mtch structs.
This does seem to work on a simple benchmark. The code below
gets about 6x faster. But on the r6rs test suite, there is
no substantial change (possibly because the caching obviates
this optimization?)
lang racket/base
(require redex/reduction-semantics)
(caching-enabled? #f)
(define-language L (e (+ e e) number))
(define t
(let loop ([n 100])
(cond
[(zero? n) 1]
[else `(+ 11 ,(loop (- n 1)))])))
(define f (redex-match L e))
(time (for ([x (in-range 1000)]) (f t)))
When I enabled this, I don't see any speedup, on the R6RS test suite
benchmark (I see minor slowdown). Here are the numbers I get, on my
laptop:
nt cache: 35537 msec
neither: 844933 msec
Jay's idea: 875306 msec
And with both on, I see a similar, minor slowdown (as compared to the
version with the nt cache).
The main difference seems to be that I'm getting about 6 "hits" per
test case on the nt-match structs (that is, I avoid work by finding an
nt-match struct) and I'm getting about 8,800 hits in the cache per
test case.
First use of the function was determining a single arity for
the enclosing module, and that arity could trigger warnings
in addition to failures to inline. For example, using `map'
on 3 arguments would trigger incorrect warnings for later
uses of `map' on 2 arguments.