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

Use Profile-Guided Optimization (PGO) to speedup programs (e.g. migrations) by up to ~14% #3303

Closed
fxamacker opened this issue May 1, 2024 · 3 comments
Assignees

Comments

@fxamacker
Copy link
Member

fxamacker commented May 1, 2024

The Go compiler supports profile-guided optimization (PGO).

  • Go 1.20 - PGO is a new preview feature
  • Go 1.21 - PGO is ready for general use and improved
  • Go 1.22 - PGO is ready for general use and further improved

Go release notes mentioned 2-14% speedup by using PGO but it might be better than that in some cases as it improves.

Updates these (and maybe others):

I opened this here in onflow/cadence because Epic #3297 mentions hardware, multiple machines, etc. to speedup migrations.

@turbolent
Copy link
Member

Now that we're on Go 1.22 we should be able to try this out more easily

@fxamacker
Copy link
Member Author

Now that we're on Go 1.22 we should be able to try this out more easily

@turbolent BTW, thank you for pushing for and bumping Go to 1.22. 👍

@turbolent
Copy link
Member

Applying PGO to the state extraction resulted in a ~2% improvement. See https://www.notion.so/flowfoundation/State-Migration-Result-Tests-01e501fceb8444cca8a598d6111f2e3c?pvs=4#f1464668c5324c0a8568a47e8b02edf6 for details.

Though the result is not that impressive, given that this is basically a free win, we should still consider building the binaries with PGO enabled when we run the migrations. cc @zhangchiqing @j1010001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants