prisma-engines
prisma-engines copied to clipboard
feat(js-connectors): create Wasm Query Engine, `query-engine-wasm-api`
This PR is based on the skyzh/wasm-connector-new
branch of neondatabase/prisma-engines
.
This PR depends on:
- https://github.com/prisma/prisma-engines/pull/4095
It implements:
- a new crate,
query-engine-wasm-api
, that is a Query Engine compatible withwasm32-unknown-unknown
- a new crate,
wasm-connectors
, which implements the wasm-compatibleProxy
andΒJsQueryable
structs equivalent to their napi.rs counterparts injs-connectors
. Lots of code is duplicated between these two modules right now. Eventually, we should unify it and use compile-time conditional flags when necessary. - Wasm support for the smoke tests
This PR will be used as a middle point between the current main
branch of prisma/prisma-engines
(as of https://github.com/prisma/prisma-engines/commit/3b74ba351abfefd10f3da2b8af3c7ed7658f8d30) and https://github.com/prisma/prisma-engines/pull/4117.
You can build a Wasm query engine via:
-
cargo build -p query-engine-wasm-api --target wasm32-unknown-unknown --release
CodSpeed Performance Report
Merging #4118 will degrade performances by 15.26%
:warning: No base runs were found
Falling back to comparing jkomyno/wasm-connector-new
(75066a6) with jkomyno/quaint-wasm
(53d95f8)
Summary
β 3
regressions
β
8
untouched benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
Benchmark | jkomyno/quaint-wasm |
jkomyno/wasm-connector-new |
Change | |
---|---|---|---|---|
β | validate (medium) |
58.3 ms | 66.4 ms | -12.21% |
β | validate (small) |
8.1 ms | 9.5 ms | -15.26% |
β | validate (large) |
270.4 ms | 298.4 ms | -9.37% |
I have refined the previous pull request to include all the changes outside of the WASM module, so that this PR's scope will only be adding the two new crates and it would be easier to rebase / merge :) https://github.com/prisma/prisma-engines/pull/4117