-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: trie-iteration-benchmark - full and shallow iteration #9114
Conversation
Nice!! Looking forward to what numbers you get! :D |
We already have a bit of code for benchmarking, even with some results: nearcore/nearcore/benches/store.rs Line 23 in e32db71
|
29585aa
to
43d9b95
Compare
example execution and output for a tiny localnet setup: cargo build && ./target/debug/neard --home ~/.near/localnet/node0 view-state trie-iteration-benchmark
|
43d9b95
to
9c6a3dc
Compare
Thanks @Longarithm, this is pretty cool and similar to what I'm doing. I considered migrating to the same framework but I'd rather keep my benchmark as a neard subcommand so that I can easily run in with just neard available without having to rely on full rust setup. |
I added some more code to this PR:
Let me know if you'd rather review this separately or if you prefer to wait for the full shallow iteration implementation. I'm happy to add it here or to move it to separate PR if it's easier to review this way. |
Here are some results for full trie iteration - without pruning - on a mainnet db, with neard stopped. TLDR - shard 3 is a killjoy
|
results for shallow iteration:
|
Interesting! I'm surprised that for shard 0 and 2 the improvement is less than a factor of 2. For shard 0 for example, roughly half of the nodes are at or above the account level. I suppose this makes sense because your stats show that simple wallets vastly outnumber smart contracts. |
This is step 1 of the following plan to benchmark how long does it take to perform shallow trie iteration. For more details about the goal please see #9101. 1. Add a neard subcommand that does full trie iteration. 2. Extend it to actually measure and report the time it takes. 3. Extend it with shallow iteration. Once all three steps are done it will be possible to benchmark the full iteration, the shallow iteration and compare the time it takes for each.
This is step 1 of the following plan to benchmark how long does it take to perform shallow trie iteration. For more details about the goal please see #9101.
Once all three steps are done it will be possible to benchmark the full iteration, the shallow iteration and compare the time it takes for each.