mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 18:43:44 +00:00
perf(react_compiler): use FxHashMap for the lookup-only aliasing node map (#24490)
`AliasingState.nodes` in `infer_mutation_aliasing_ranges.rs` is only accessed via `get`/`get_mut`/`insert`/`entry`/`contains_key` — never iterated — so its insertion order is never observed. Switching it from `FxIndexMap` to `FxHashMap` drops the entry `Vec` that `IndexMap` maintains, and since `IdentifierId -> Node` is unique to this pass, it also removes the `IndexMap` monomorphization (small binary-size win). The order-critical `created_from`/`captures`/`aliases`/`maybe_aliases` maps (iterated into a worklist that drives diagnostic order) stay `FxIndexMap`. Snapshots unchanged (`cargo test -p oxc_react_compiler`).
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -108,12 +108,12 @@ impl Node {
|
||||
}
|
||||
|
||||
struct AliasingState {
|
||||
nodes: FxIndexMap<IdentifierId, Node>,
|
||||
nodes: FxHashMap<IdentifierId, Node>,
|
||||
}
|
||||
|
||||
impl AliasingState {
|
||||
fn new() -> Self {
|
||||
AliasingState { nodes: FxIndexMap::default() }
|
||||
AliasingState { nodes: FxHashMap::default() }
|
||||
}
|
||||
|
||||
fn create(&mut self, place: &Place, value: NodeValue) {
|
||||
|
||||
Reference in new issue
Block a user