-
Notifications
You must be signed in to change notification settings - Fork 249
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
feat(query-engine-wasm): Decrease gzipped Wasm size to 1.3MB #4530
Conversation
…asm32-unknown-unknown compilation
…github.com:prisma/prisma-engines into feat/sql-query-connector-on-wasm32-unknown-unknown
…o feat/query-core-on-wasm32-unknown-unknown
…to unexpected case
* qe-wasm: Partially fix the test suite 1. Bash script for build did not abort on error, hence sed error on linux went unnoticed. 2. We don't actually need sed trickery sincce `wasm-pack` has a flag for changing binary name. 3. `tracing` feature does not actually work on WASM even partially: it panics on `Instant` invokation as soon as first span is created. Since we are running tests with all preview features enabled, that means that practically any test panics now. Disabled it again. A lot of tests are still failing on ThreadRng invocation and stacktrace is not really helpful, but I still think it's better if we get it working. * Update query-engine/query-engine-wasm/build.sh
CodSpeed Performance ReportMerging #4530 will not alter performanceComparing Summary
|
|
||
[package.metadata.wasm-pack.profile.release] | ||
wasm-opt = [ | ||
"-Oz", # super focus on code size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much do we win on -Oz
comapring to -Os
? Last time we looked into it, size win was quite marginal but performance hit was quite big. I'd rather us do this flag separately, when we are ready to run the benchmarks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIth -0s
, we'd have:
946B README.md
355B package.json
28.5kB query_engine_bg.js
3.4MB query_engine_bg.wasm
4.7kB query_engine.d.ts
538B query_engine.js
=== Tarball Details ===
name: @prisma/query-engine-wasm
package size: 1.3 MB
unpacked size: 3.4 MB
So, still 1.3MB. At some point we'll need to re-run the benchmarks to ensure we aren't optimising too much for size while worsening the performance.
|
||
[package.metadata.wasm-pack.profile.release] | ||
wasm-opt = [ | ||
"-Oz", # super focus on code size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"-Oz", # super focus on code size | |
"-Os", # focus on code size |
This PR is deprecated by #4552. |
This PR contributes to https://github.com/prisma/team-orm/issues/584. This PR depends on #4466.
Before this PR, the gzipped
@prisma/query-engine-wasm
was 1.7MB.Miscellaneous
Passing the
--reference-types
option towasm-pack build
, or the--remove-non-js-ops
option towasm-opt
results in runtime errors when running the example. Reference types in particular would be good to have, as they would likely improve the CPU performance of@prisma/query-engine-wasm
.