tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

louise_rt_prims::find: an SSE2 instantiation, SWAR the fallback

The first SWAR-only version of the kernel scanned misses at about
3.7 GB/s against the 6 GB/s of Rust std's str::contains (SSE2-class), a
regression for string.contains, which now shares the kernel. memchr's
answer is the one adopted here: the generic two-byte-filter algorithm,
instantiated per target — 16-byte SSE2 vectors on x86-64 (in the
baseline, so no runtime detection; stable intrinsics, no nightly), SWAR
over a u64 elsewhere. The dispatch by needle length is shared, the tests
exercise every instantiation compiled for the target, and the aarch64
type-check builds the SWAR fallback.

Measured (8 MiB corpus, misses and end-of-corpus hits, best of 5
interleaved on a shared host; search time = total minus the 0.30 s
corpus build):

- string.contains: 0.21 s (std) -> 0.08 s (kernel), about 2.6x
- string.find: as fast as contains (same kernel)
- a naive byte-level find in Louise: about 100x slower than the prim

Issue #380.

olivier · il y a 3 sem. · 955f05b921349fb97541bc8b0159116850194252

Parents 51708ff

3 fichiers modifiés, 434 ajouts, 238 suppressions