Skip to content

Support incremental workspace optimizations - #84

Merged
maurolacy merged 9 commits into
CosmWasm:mainfrom
mandrean:main
Jul 22, 2022
Merged

maurolacy merged 9 commits into
CosmWasm:mainfrom
mandrean:main

Conversation

@mandrean

@mandrean mandrean commented Jul 12, 2022

Copy link
Copy Markdown
Contributor

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

Comment thread optimize_workspace.sh
@webmaster128
webmaster128 requested a review from maurolacy July 12, 2022 09:39
Comment thread optimize_workspace.sh Outdated

@maurolacy maurolacy left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread optimize_workspace.sh Outdated
Comment thread optimize_workspace.sh Outdated
Comment thread optimize_workspace.sh Outdated
Comment thread optimize_workspace.sh Outdated
Comment thread optimize_workspace.sh Outdated
@maurolacy

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

Comment thread CHANGELOG.md Outdated
@mandrean

Copy link
Copy Markdown
Contributor Author

Pushed changes, have a look again @maurolacy

@maurolacy

Copy link
Copy Markdown
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.

3 participants