You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: decide whether identifier interning closes the compile-cost issue #317
Owner decision: accept the interner that landed as the answer to this issue and close it, or re-profile and finish the job.
Identifiers are interned (CanonicalStorage in common.rs): clone is a refcount bump and equality is a pointer compare.
It differs from the original proposal in two ways:
Hashing still walks the string, on purpose, so HashMap lookups by &str keep working.
About 128 HashMap<Ident<Canonical>, _> maps still use std SipHash; 39 use the FxHash IdentMap alias.
Nobody has re-profiled WRLD3 against the original baseline (identifier hashing ~14% and cloning ~5% of compile instructions).
Fix
Recommended: close as done.
Later compile-performance work (docs/design/engine-performance.md, "C3" and "Compile round 3") records the interning and a SipHash removal over the engine's identifiers, and names other costs (allocation, canonicalize calls) as the remaining levers.
Alternative: profile cargo bench -p simlin-engine --bench compiler -- wrld3 under callgrind, and move the remaining SipHash maps to IdentMap only if hashing still shows up.
changed the title [-]Intern Ident<Canonical> strings via salsa::interned to reduce hashing and cloning overhead[/-][+]engine: identifier hashing and cloning cost ~20% of compile time[/+]on Oct 12, 2026
changed the title [-]engine: identifier hashing and cloning cost ~20% of compile time[/-][+]engine: decide whether identifier interning closes the compile-cost issue[/+]on Oct 12, 2026
Activity
engine: compiler optimization pass (C-LEARN -33%, LTM on world3 9.8x,…
[-]Intern Ident<Canonical> strings via salsa::interned to reduce hashing and cloning overhead[/-][+]engine: identifier hashing and cloning cost ~20% of compile time[/+][-]engine: identifier hashing and cloning cost ~20% of compile time[/-][+]engine: decide whether identifier interning closes the compile-cost issue[/+]bpowers commentedon Oct 12, 2026
Fixed by #1089, on main as 78b0409.