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

Cache optimization with wasm-opt #1152

Open
kartva opened this issue Jun 23, 2022 · 2 comments
Open

Cache optimization with wasm-opt #1152

kartva opened this issue Jun 23, 2022 · 2 comments

Comments

@kartva
Copy link

kartva commented Jun 23, 2022

Rebuilding a project with wasm-pack right now can take a (relatively) long time because wasm-opt is run every time by default to optimize the produced WebAssembly binaries, since the default configuration for wasm-pack build is --release.

Hashing the source files (or webassembly binaries) and only running wasm-opt in case their checksum changed would be nice.

Somewhat unrelated:
Why is the default for wasm-pack build release mode when cargo has debug as the default mode?

@LeoDog896
Copy link

When I went to work on this, it turns out it's quite hard to work in dev mode with optimization - I've raised an issue (#1218) for this.

@elijah-potter
Copy link

Would be it be possible to implement this at least for non-debug builds? Happy to look more into this myself.

max-sixty added a commit to max-sixty/prql that referenced this issue Mar 18, 2023
We no longer need to run a build command in the playground on `prql-js`, since the command is now part of `prql-js`'s `preinstall`.

This givs us some speedup — 23s down from 32s — but most of the time is still taken up by re-running `wasm-opt`.

There's an issue for this in rustwasm/wasm-pack#1152. But probably `wasm-opt` should be run by `build.rs` which knows whether it requires re-running based on changed input files https://doc.rust-lang.org/cargo/reference/build-scripts.html

I think the current state is probably OK — we still get instant feedback when developming the playground; this is only required when _starting_ the playground on changing `prql-js`
max-sixty added a commit to PRQL/prql that referenced this issue Mar 18, 2023
We no longer need to run a build command in the playground on `prql-js`, since the command is now part of `prql-js`'s `preinstall`.

This givs us some speedup — 23s down from 32s — but most of the time is still taken up by re-running `wasm-opt`.

There's an issue for this in rustwasm/wasm-pack#1152. But probably `wasm-opt` should be run by `build.rs` which knows whether it requires re-running based on changed input files https://doc.rust-lang.org/cargo/reference/build-scripts.html

I think the current state is probably OK — we still get instant feedback when developming the playground; this is only required when _starting_ the playground on changing `prql-js`
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

No branches or pull requests

3 participants