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

perf(accountsdb): begin optimizing snapshot generation #290

Merged
merged 16 commits into from
Oct 15, 2024

Conversation

InKryption
Copy link
Contributor

@InKryption InKryption commented Sep 30, 2024

Closes #282.

There is likely room for more optimizations, but this sets a good foundation for that work, and I think keeping this down in scope and easy-ish at this level of review would be best - more work can be done in a follow up PR.

@InKryption InKryption force-pushed the ink/faster-snapshot-gen branch 2 times, most recently from 8c4518c to afdedaf Compare September 30, 2024 19:11
@InKryption
Copy link
Contributor Author

Spurious CI failure: https://github.com/Syndica/sig/actions/runs/11112601615/job/30875047639?pr=290 (reran the job)

@InKryption InKryption force-pushed the ink/faster-snapshot-gen branch 9 times, most recently from df294e3 to 8c5b235 Compare October 8, 2024 00:59
@InKryption InKryption marked this pull request as ready for review October 8, 2024 01:00
@InKryption
Copy link
Contributor Author

InKryption commented Oct 8, 2024

The change in 78c6bc8 yields a 1.75x speed increase in the accountsdb benchmark:
image

@InKryption InKryption changed the title perf(accountsdb): optimize snapshot generation perf(accountsdb): begin optimizing snapshot generation Oct 8, 2024
Copy link
Contributor

@0xNineteen 0xNineteen left a comment

Choose a reason for hiding this comment

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

amazing work - cleaner and faster! 😌 - few small things but other than that lgtm

src/accountsdb/db.zig Show resolved Hide resolved
src/accountsdb/db.zig Show resolved Hide resolved
src/accountsdb/db.zig Show resolved Hide resolved
src/accountsdb/db.zig Outdated Show resolved Hide resolved
src/accountsdb/db.zig Show resolved Hide resolved
src/accountsdb/db.zig Show resolved Hide resolved
src/accountsdb/db.zig Outdated Show resolved Hide resolved
src/accountsdb/db.zig Show resolved Hide resolved
src/accountsdb/db.zig Outdated Show resolved Hide resolved
src/accountsdb/db.zig Show resolved Hide resolved
 * `validateLoadFromSnapshot`: now accepts a parameter struct which
   only accepts exactly the relevant data needed to validate the
   specified snapshot(s).

 * `generateFullSnapshotWithCompressor`: re-organized & simplified.

 * `generateIncrementalSnapshotWithCompressor`: heavily re-organized,
   and now returns the associated `BankIncrementalSnapshotPersistence`
   to represent the incremental snapshot data; this was done because
   all of the data in `IncSnapshotGenerationInfo` is redundant with
   the aforementioned struct, except for the incremental slot, which
   is already known by the caller, since they supply it as a primary
   function parameter.
Decouples the various behaviours of this function into standalone
functions, in order to facilitate restructuring it for optimizations,
whilst retaining the essence of this procedure.
Pull out the timer/duration, declare its explicit error set, and
clarify doc comments.
InKryption and others added 3 commits October 9, 2024 17:42
Co-authored-by: x19 <100000306+0xNineteen@users.noreply.github.com>
Co-authored-by: x19 <100000306+0xNineteen@users.noreply.github.com>
InKryption and others added 2 commits October 9, 2024 18:01
Co-authored-by: x19 <100000306+0xNineteen@users.noreply.github.com>
0xNineteen
0xNineteen previously approved these changes Oct 9, 2024
Copy link
Contributor

@0xNineteen 0xNineteen left a comment

Choose a reason for hiding this comment

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

awesome work 😄 -- :shipit:

@InKryption InKryption merged commit 5f49dce into main Oct 15, 2024
6 checks passed
@InKryption InKryption deleted the ink/faster-snapshot-gen branch October 15, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

perf(accountsdb): optimize snapshot generation
2 participants