[WIP] perf: remove TrieUpdates::removed_nodes #13872
Draft
+278
−362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The basic idea is to combine one
HashMap<Nibbles, BranchNodeCompact>
and oneHashSet<Nibbles>
into oneHashMap<Nibbles, Option<BranchNodeCompact>>
so that the hot operations can be optimized.Notable changes
Benchmarks
Benchmarks
Summary
(unit: microseconds)
Before
30,601.00 tps, 1,056,914,565.83 gps, no chain lag, 585111076/609686114 μs
54,594.73 tps, 1,146,512,812.78 gps, no chain lag, 323457659/332195794 μs
6,331.00 tps, 882,451,082.10 gps, no chain lag, 1254878698/1270738569 μs
After
30,601.00 tps, 1,056,918,521.38 gps, no chain lag, 510748357/534427714 μs
54,601.00 tps, 1,146,644,512.40 gps, no chain lag, 293110568/302033002 μs
6,331.00 tps, 882,444,901.42 gps, no chain lag, 1139740260/1157216500 μs
Others