Skip to content

perf: Add resetBatch optimization to fastnode genesis#730

Merged
tac0turtle merged 3 commits into
cosmos:masterfrom
osmosis-labs:dev/fastnode_resetbatch
Apr 13, 2023
Merged

perf: Add resetBatch optimization to fastnode genesis#730
tac0turtle merged 3 commits into
cosmos:masterfrom
osmosis-labs:dev/fastnode_resetbatch

Conversation

@ValarDragon
Copy link
Copy Markdown
Contributor

Add reset batch optimization to writing fast nodes at genesis, mirroring whats done for normal node saving.

This is really the same idea as #652 , but at the genesis-only level right now, as thats whats already done for normal nodes, and deemed normal at genesis. (Whereas #652 may have to reason about different guarantees, e.g. signalling when the full batch is completed)

This brings a significant speedup for InitGenesis logic.

Before (370 s + GC):
image

After (41.3 s):
image

This is also with massive GC reductions (due to far less leveldb.grow operations), and lower peak RAM usage. (One less full-module write copy)

@ValarDragon ValarDragon requested a review from a team April 9, 2023 21:09
@ValarDragon
Copy link
Copy Markdown
Contributor Author

Marked this and #729 as backport v0.20.x, if thats alright. Would like to get Osmosis updated to have these, to reduce our InitGenesis overheads

@tac0turtle tac0turtle enabled auto-merge (squash) April 13, 2023 09:27
@tac0turtle tac0turtle merged commit b186ae7 into cosmos:master Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants