-
Notifications
You must be signed in to change notification settings - Fork 32
Suggested change for TreeOp::Put #12
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
Comments
That was chosen for performance - I hate unneccessary clones. Would switching to |
Ah but you're right that it's getting cloned into the node - maybe you're right and we can just change this 👌 |
Made the change to try it out and see the perf difference. It's in my treeop branch
Bench results (just showing Put related ones):
test bench_put_insert_random: 186,201,818 (&[u8]) --- 168,084,786 (Vec<u8>) ns/iter
test bench_put_insert_sequential: 23,737,681 (&[u8]) --- 24,472,033 (Vec<u8>) ns/iter
test bench_put_update_random: 206,077,496 (&[u8]) --- 194,155,280 (Vec<u8>) ns/iter
test bench_put_update_sequential 25,539,183 (&[u8]) --- 24,806,745 (Vec<u8>) ns/iter
Performance wise they're pretty close. I'll settle for 23,809 random inserts per/sec 😄
Minimal touchpoints to make the change - 👍 to the designer of this thing!
Closing this because #15 now uses |
* Feature gate jemallocator separately from 'full' feature * Upgrade dependencies * Use little-endian 32-bit integers for lengths in kv_hash input encoding * Use SHA-512/256 hash algorithm instead of Blake 3 * Export MerkSource * Bump version to 2.0.0 * Add prefixes to KV hash and node hash inputs * Add large sequential deletion test (was causing stack overflow) * Recurse into child ops before removing node in Delete op * Update test hashes for blake3 -> sha2 change * Format * Add unit test which tests tree structure after applying recursive delete * Fix deletion algorithm to ensure we remove correct node after recursing * Fix warning * Add repair method * Add method for recursively getting value from Tree * Add Snapshot and extract common code from Merk into functions * Add create_path method to TempMerk * Export Snapshot * cargo fmt and we're not using sha2 * Fix hash stuff * Fix hash tests and clippy Co-authored-by: Matt Bell <mappum@gmail.com>
Not a big deal, but one suggestion I have is to change
TreeOp::Put(&'a[u8])
toTreeOp::Put(Vec<u8>)
. Why?Node.value
is already aVec<u8>
Put(Vec<u8>)
from external calls - (again simplifies lifetime stuff)The text was updated successfully, but these errors were encountered: