A `string-split` on a big string with lots of small matches sends the
regexp matcher a big string many times. Decoding 1024 bytes each time
is too much. Decoding 32 bytes is be a better trade-off between
chunking for large matches and being lazy for small matches.
For example, on a 60MB string with a space every 15 characters or so,
splitting on a space is about 3 times as fast with this adjustment.
I tried a few chunk sizes, and 32 worked the best in my experiments.
Naturally, as more bytes are read, the chunk size ramps up, so it's
a question of initial size; larger matches are relatively insensitive to
the initial size (so, again, it makes little sense to cater to large
matches with a large initial decoding size of 1024 bytes).
Cuts about 1/3 of the time for a string-hashing microbenchmark
provided by Pedro Ramos:
#lang racket
(define alphabet "abcdefghijklmnopqrstuvwxyz")
(define (random-word n)
(build-string n (lambda (x) (string-ref alphabet (random 26)))))
(define words (for/list ([k 1000000])
(random-word 3)))
(define d (make-hash))
(time (for ([w (in-list words)])
(if (hash-has-key? d w)
(hash-set! d w (add1 (hash-ref d w)))
(hash-set! d w 1))))
When `x` and `x`-with-a-mark are both defined, then the order of
definitions affected the binding that `(provide x)` would export
in a submodule that uses `#f` as its language. The problem was
in the implementation of the implicit `require`, which needs to
look up a variable's symbolic name in two different environments
to set up the right mapping.
Add synchronization so that the enumerated interleavings cover
all of the ones that should be possible.
Using `(sync (system-idle-evt))` as a barrier works as long as
the implementation of the library being tested doesn't itself
use `(sync (system-idle-evt))`. That seems like a safe-enough
assumption for a test.
Fix use of wrong array element during sort, where using the wrong element
caused "Windows source" to be sorted before "Windows (x86, 32-bit)".
(The wrong-element bug was introduced with changed to support the button
that downloads directly from the default mirror.)
Closes PR 14655 and PR 14656
These links reflect soft links that are in place at
"mirror.racket-lang.org", but they're needed as links/rewrite on the
main site for some purposes, such as references from the tech-report
pages.
- make a logger for drracket-related #lang problems
- change read-language's docs to indicate that it can return #f
- adjust a bunch of calls to read-language for the case that it returns #f
with the goal of making that be the same as a get-info function that
always returns the given default
- mention `read-language` in the guide section entitled
"Source-Handling Configuration"