Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
topdown: Remove unnecessary allocations for binding undos
The undo was being allocated on the heap unnecessarily. Removing the heap allocation provides a slight speedup. $ benchstat /tmp/old.txt /tmp/new.txt name old time/op new time/op delta ArrayIteration/10-20 24.7µs ± 1% 24.0µs ± 1% -2.49% (p=0.008n=5+5) ArrayIteration/100-20 125µs ± 1% 122µs ± 1% -2.88% (p=0.008n=5+5) ArrayIteration/1000-20 1.15ms ± 1% 1.12ms ± 1% -2.66% (p=0.008n=5+5) ArrayIteration/10000-20 11.9ms ± 2% 11.6ms ± 1% -2.52% (p=0.008n=5+5) SetIteration/10-20 28.3µs ± 1% 27.8µs ± 1% -1.73% (p=0.008n=5+5) SetIteration/100-20 157µs ± 1% 154µs ± 1% -1.81% (p=0.008n=5+5) SetIteration/1000-20 1.47ms ± 1% 1.44ms ± 1% -2.00% (p=0.008n=5+5) SetIteration/10000-20 15.8ms ± 1% 16.0ms ± 4% ~ (p=0.690n=5+5) ObjectIteration/10-20 27.9µs ± 1% 27.8µs ± 1% ~ (p=0.222n=5+5) ObjectIteration/100-20 155µs ± 1% 152µs ± 1% -1.96% (p=0.016n=5+5) ObjectIteration/1000-20 1.46ms ± 1% 1.44ms ± 1% -1.73% (p=0.008n=5+5) ObjectIteration/10000-20 15.6ms ± 1% 15.2ms ± 2% -2.50% (p=0.016n=5+5) Signed-off-by: Torin Sandall <torinsandall@gmail.com>
- Loading branch information