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

Support incremental workspace optimizations #84

Merged
merged 9 commits into from
Jul 22, 2022
Merged

Conversation

mandrean
Copy link
Contributor

@mandrean mandrean commented Jul 12, 2022

The Rust compiler has superb support for incremental builds and other optimizations to keep down (re-)compilation times.

Unfortunately, workspace-optimizer will re-optimize WASM binaries even if they didn't change since the last run. In monorepos with many contracts this means a lot of pointless waiting, even on a fast machine.

This PR checks the intermediate SHA against the previous one, and only re-optimizes if it changed.

Tested in a monorepo with ~10 contracts:

  • Fresh run from clean state -> optimizes all binaries
  • Rerun again -> skip all optimizations, no changes detected
  • Make a small change in one contract -> only re-optimizes that one, skips the rest

Update: also tested:

  • Fresh run, then delete one optimized binary from artifacts/, then rerun again -> re-optimizes missing binary, skips the rest

optimize_workspace.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

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

Looks good. Please address suggestions and we merge.

optimize_workspace.sh Outdated Show resolved Hide resolved
optimize_workspace.sh Outdated Show resolved Hide resolved
optimize_workspace.sh Outdated Show resolved Hide resolved
optimize_workspace.sh Outdated Show resolved Hide resolved
optimize_workspace.sh Outdated Show resolved Hide resolved
@maurolacy
Copy link
Contributor

Also, please add an entry in CHANGELOG.md about this change.

Co-authored-by: Mauro Lacy <maurolacy@users.noreply.github.com>
@mandrean
Copy link
Contributor Author

@maurolacy Done & pushed! Also see my comment about the scope of $WASM.

CHANGELOG.md Outdated Show resolved Hide resolved
@mandrean
Copy link
Contributor Author

Pushed changes, have a look again @maurolacy

@maurolacy
Copy link
Contributor

👍🏼

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.

None yet

3 participants