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

popm/wasm: add wasm-opt target to optimise wasm binary #146

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

joshuasing
Copy link
Contributor

@joshuasing joshuasing commented Jun 12, 2024

Summary
Add wasm-opt target to web/Makefile that optimises the WASM binary output from the wasm target using wasm-opt from binaryen.

From testing, this seems to shrink the output binary's size by around 1M.

joshua@ringo web % du -hs webapp/popminer.wasm 
 12M    webapp/popminer.wasm
joshua@ringo web % m wasm-opt
/opt/homebrew/bin/wasm-opt
wasm-opt -Oz /Users/joshua/Projects/hemilabs/heminetwork/web/webapp/popminer.wasm -o /Users/joshua/Projects/hemilabs/heminetwork/web/webapp/popminer.wasm.opt --enable-bulk-memory --intrinsic-lowering
mv /Users/joshua/Projects/hemilabs/heminetwork/web/webapp/popminer.wasm.opt /Users/joshua/Projects/hemilabs/heminetwork/web/webapp/popminer.wasm
joshua@ringo web % du -hs webapp/popminer.wasm 
 11M    webapp/popminer.wasm

Changes

  • Add wasm-opt target to web/Makefile that runs wasm-opt on the WASM binary created by the wasm target

Base automatically changed from joshua/web-popm/improve-go to main June 17, 2024 15:40
@joshuasing joshuasing force-pushed the joshua/web-popm/opt branch from 0dd47a3 to 46132b2 Compare June 17, 2024 15:45
@joshuasing joshuasing added type: enhancement This improves existing functionality area: popm/wasm This is a change to the WASM popm (PoP Miner) area: make This changes a Makefile size: XS This change is very small (+/- <10) labels Jun 17, 2024
@joshuasing joshuasing merged commit b5b5647 into main Jun 26, 2024
4 checks passed
@joshuasing joshuasing deleted the joshua/web-popm/opt branch June 26, 2024 14:20
web3cryptoguy pushed a commit to web3cryptoguy/heminetwork that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: make This changes a Makefile area: popm/wasm This is a change to the WASM popm (PoP Miner) size: XS This change is very small (+/- <10) type: enhancement This improves existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants