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

Optimize atree inlining migration by over 1 hour on test vm #5913

Conversation

fxamacker
Copy link
Member

@fxamacker fxamacker commented May 14, 2024

This PR reduces the duration of Crescendo (mainnet25) network upgrade by optimizing the first migration (atree migration using Cadence 0.42) during Crescendo network upgrade.

This optimizes atree migration by using new functions added at github.com/onflow/atree:

  • NondeterministicFastCommit() for nondeterministic commit to atree storage
  • BatchPreload() to preload atree slabs in parallel

Informal test showed ~15% speedup (about 1 hour 20 minutes faster 🎉 ) on m1 vm using nworkers=40 with all storage checks and validations enabled. Using more cpu cores or different input data (testnet vs mainnet data) may show different speedups.

Most of the changes for this speedup are at github.com/onflow/atree. More info about atree inlining:

This commit optimizes atree migration by using new atree functions:
- NondeterministicFastCommit() for nondeterministic commit to atree storage
- BatchPreload() to preload atree slabs in parallel

Most of the changes are in atree, so this change to migration program
in flow-go is not extensive.

For more info, see http://github.com/onflow/atree/releases
@fxamacker fxamacker requested review from a team May 14, 2024 18:13
@fxamacker fxamacker self-assigned this May 14, 2024
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Great work!

@turbolent turbolent requested a review from a team May 14, 2024 20:41
@turbolent turbolent merged commit 1e5cc7d into feature/atree-inlining-cadence-v0.42 May 14, 2024
55 checks passed
@turbolent turbolent deleted the fxamacker/optimize-commit-and-preload-for-atree-inlining-cadence-v0.42 branch May 14, 2024 20:48
@fxamacker fxamacker changed the title Optimize Cadence v0.42 + atree inlining migration Optimize atree inlining migration by over 1 hour on test vm Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants