-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(nns): Improve range neurons performance for stable store (#2033
) When scanning neurons in the main StableBTreeMap, instead of doing a separate traversal of the auxiliary StableBTreeMaps for EACH neuron in the result set, ranges of each auxiliary StableBTreeMap are used (and scanned in parallel). This gets around a 40% performance improvement. This method, while not currently extensively used, will be used more after the migration of neurons to stable storage. Benchmark results before the change: ``` // Output from benchmark test Benchmark: range_neurons_performance total: instructions: 47.07 M (improved by 41.47%) heap_increase: 0 pages (no change) stable_memory_increase: 0 pages (no change) ``` ``` range_neurons_performance: total: instructions: 80415437 heap_increase: 0 stable_memory_increase: 0 scopes: {} ``` After the change (what's in PR): ``` range_neurons_performance: total: instructions: 47070657 heap_increase: 0 stable_memory_increase: 0 scopes: {} ```
- Loading branch information
1 parent
9fc5ab4
commit 4bd8e1d
Showing
4 changed files
with
225 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
benches: | ||
add_neuron_active_maximum: | ||
total: | ||
instructions: 45003037 | ||
instructions: 35991301 | ||
heap_increase: 1 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
add_neuron_active_typical: | ||
total: | ||
instructions: 2703302 | ||
instructions: 1836362 | ||
heap_increase: 0 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
add_neuron_inactive_maximum: | ||
total: | ||
instructions: 122465697 | ||
instructions: 98457016 | ||
heap_increase: 1 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
add_neuron_inactive_typical: | ||
total: | ||
instructions: 10581822 | ||
instructions: 7574043 | ||
heap_increase: 0 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
version: 0.1.3 | ||
range_neurons_performance: | ||
total: | ||
instructions: 47070657 | ||
heap_increase: 0 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
version: 0.1.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters