Commit 4606637
authored
perf: use Box<Node> instead of Rc<Node> in BTreeMap iterator (#360)
This PR replaces the use of reference-counted `Rc<Node>` pointers with
unique `Box<Node>` allocations in the `BTreeMap` iterator to reduce
overhead.
btreemap
```
instructions:
status: Improvements detected 🟢
counts: [total 285 | regressed 0 | improved 9 | new 0 | unchanged 276]
change: [max 0 | p75 -97.33K | median -147.22K | p25 -481.26K | min -5.34M]
change %: [max 0.00% | p75 -0.02% | median -0.03% | p25 -0.06% | min -3.25%]
```
btreeset
```
instructions:
status: Improvements detected 🟢
counts: [total 100 | regressed 0 | improved 2 | new 0 | unchanged 98]
change: [max +625.36K | p75 -288 | median -27.44K | p25 -80.94K | min -377.91K]
change %: [max +0.05% | p75 -0.07% | median -0.30% | p25 -1.17% | min -2.35%]
```
Previous change #356
was adding `Rc<Node>` (vs simple moving) which added some improvements
as well as regressions.1 parent 8d97803 commit 4606637
3 files changed
Lines changed: 388 additions & 389 deletions
0 commit comments