Files
oxc-project__oxc/crates
Dunqing 1f902a6962 perf(isolated_declarations): key scope maps by Ident (#26380)
The declaration scope tree keyed its `bindings` and `references` maps by `Str`, built from `ident.name.into()`. That throws away the hash `Ident` already carries, so every identifier reference was hashed again on insert, again when resolved against the scope's bindings on scope exit, and once more for each parent scope an unresolved reference propagated to.

Key both maps by `Ident` with `IdentHashMap`, and take `Ident` in the lookup helpers so callers pass the AST name straight through. The only non-AST caller, `create_unique_name`, builds an `Ident` instead of a `Str`.

`isolated-declarations/vue-id.ts` benchmark: 4.38 ms -> 3.85 ms (-12%).

AI-assisted.
2026-09-14 02:34:16 +00:00
..