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.

Optimiser: hash ids with one multiply, not SipHash (#316)

The simplifier keeps its variables and functions in hash sets and maps,
and std's SipHash on those u32 ids (hash, insert, rehash) was about a
fifth of the optimiser's time: perf showed it under sweep_in, uses and
free_vars. louise_core gets an IdHasher (one rotate, xor and multiply
per word, as rustc's FxHasher; no new dependency) and IdSet / IdMap,
which the simplifier, fuse and precompile now use. Nothing the compiler
emits depends on iteration order (std's maps are seeded per process and
the output does not change between runs), so neither does this.

The optimised Core is byte-identical over every tests/run program,
example and toki2. With the previous commit, `louise core` on toki2
runs 13.9 G instructions where it ran 23.0 G (-40%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · 1c4d300119beda32aab0d675da094976fcbc6960

Parents c633ab1

5 fichiers modifiés, 120 ajouts, 51 suppressions