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.
This covers all of the html files in mailman's template directory, and
we should have a consistent look for all pages. (Including archived
messages.) Also tweak the front page to have a link to the mailman
"listinfo" page with the complete list of the hosted mailing lists.
Add a `resource/referrer' abstraction for referrers, on top of plain
resources. (When the referrer is `values', it just returns the plain
resource.) Also add `url-of' to replace `get-resource-path'.
This turned out to be a bad idea. The thing is that some resources need
to be referred to in multiple ways -- for example, different texts in
links of different kinds, or using the URL directly in some cases. The
existence of `get-resource-path' is a witness for this problem, since it
was used for such cases -- this function is removed as well.
There's no point in trying to generalize this here: instead, go back to
a simpler system where a resource always returns its URL (with an
optional argument to get an absolute URL). When a `referrer'
functionality is needed, build it on top of that, in a place where it
makes more sense. (That is, in a specific code for generating content,
where there could be a decision that resources have plain links and also
a very short link for use in navbars.) Otherwise, it's usually simpler
to just define resources and referrers separately (as different
bindings, the latter uses the former).
Turns out that bash's regexps (using `=~') changed so that quoting them
matches a literal string, and it seems dangerous to rely on parsing
unquoted regexps. One way around this is to put the regexp in a
variable, but for the two simple uses that this script had, it's easy to
avoid regexps completely.
redex patterns a bunch:
- repeats are turned into wrappers in sequences,
- names are all explicit,
- non-terminals are wrapped with `nt',
- cross patterns always have the hyphens in them.
- ellipses names are normalized (so there are no "hidden"
name equalities); this also means that repeat patterns
can have both a regular name and a mismatch name
Also, added a match-a-pattern helper macro that checks to make sure
that functions that process patterns don't miss any cases
to be a hierarchical-list-item<%> object, but now it is
a list of language names (same information, different data)
and one place didn't get updated.
Closes PR 12462