Skip to content
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

fix(storage): Improve get nextkey performance when we have txs #3961

Merged
merged 10 commits into from
May 23, 2024

Conversation

dimartiro
Copy link
Contributor

@dimartiro dimartiro commented May 16, 2024

Changes

Improve TrieState NextKey performance by keeping the keys sorted in memory

Tests

make test

Issues

closes: #3958

Benchmarks

Case time / op bytes / op allocs / op
old implementation 920289771 ns/op 993969728 B/op 11610410 allocs/op
new implementation 1270280 ns/op 208029 B/op 12002 allocs/op

Primary Reviewer

@jimjbrettj

Copy link
Contributor

@jimjbrettj jimjbrettj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nice work here!

@dimartiro dimartiro self-assigned this May 20, 2024
lib/runtime/storage/storagediff.go Outdated Show resolved Hide resolved
lib/runtime/storage/storagediff.go Outdated Show resolved Hide resolved
lib/runtime/storage/trie.go Outdated Show resolved Hide resolved
lib/runtime/storage/trie.go Show resolved Hide resolved
lib/runtime/storage/trie.go Outdated Show resolved Hide resolved
@dimartiro dimartiro force-pushed the diego/improve-trie_state-next_key branch from 08c8d9c to b16a9bd Compare May 20, 2024 21:35
Copy link
Member

@edwardmack edwardmack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

@dimartiro dimartiro merged commit ab28708 into development May 23, 2024
24 checks passed
@dimartiro dimartiro deleted the diego/improve-trie_state-next_key branch May 23, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix(lib/runtime/storage): improve NextKeys time complexity
5 participants