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

feat(js-connectors): create Wasm Query Engine, query-engine-wasm-api #4118

Closed
wants to merge 13 commits into from

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Aug 7, 2023

This PR is based on the skyzh/wasm-connector-new branch of neondatabase/prisma-engines.

This PR depends on:

It implements:

  • a new crate, query-engine-wasm-api, that is a Query Engine compatible with wasm32-unknown-unknown
  • a new crate, wasm-connectors, which implements the wasm-compatible Proxy and JsQueryable structs equivalent to their napi.rs counterparts in js-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 3b74ba3) and #4117.


You can build a Wasm query engine via:

  • cargo build -p query-engine-wasm-api --target wasm32-unknown-unknown --release

skyzh and others added 10 commits July 31, 2023 15:03
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
Signed-off-by: Alex Chi <iskyzh@gmail.com>
…t driver object as with napi.rs, rename Wasm name to "libquery_wasm"
@jkomyno jkomyno changed the base branch from main to jkomyno/quaint-wasm August 7, 2023 23:07
jkomyno and others added 3 commits August 8, 2023 01:10
* support http mode for neon driver

Signed-off-by: Alex Chi <iskyzh@gmail.com>

* apply comments

Signed-off-by: Alex Chi <iskyzh@gmail.com>

---------

Signed-off-by: Alex Chi <iskyzh@gmail.com>
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 7, 2023

CodSpeed Performance Report

Merging #4118 will degrade performances by 15.26%

⚠️ 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

⚠️ 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%

@jkomyno jkomyno mentioned this pull request Aug 7, 2023
@skyzh
Copy link
Contributor

skyzh commented Aug 9, 2023

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 :) #4117

@janpio janpio added the topic: edge functions formerly phase 2 label Sep 26, 2023
@janpio janpio closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: edge functions formerly phase 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants