prisma-engines icon indicating copy to clipboard operation
prisma-engines copied to clipboard

experiment: try compiling Query Engine's libquery to WebAssembly

Open jkomyno opened this issue 1 year ago • 4 comments

For context, see Slack.

jkomyno avatar Jun 20 '23 14:06 jkomyno

CodSpeed Performance Report

Merging #4050 feat/wasm-qe (eacd11a) will not alter performances.

Summary

🔥 0 improvements ❌ 0 regressions ✅ 11 untouched benchmarks

🆕 0 new benchmarks ⁉️ 0 dropped benchmarks

codspeed-hq[bot] avatar Jun 20 '23 14:06 codspeed-hq[bot]

Hi @jkomyno, great work and this PR is very helpful for future integration with serverless drivers like https://github.com/prisma/prisma/issues/19409. We are doing similar experiments at @neondatabase and successfully compiled Prisma engine to WASM and integrated our driver with Prisma. In case you are interested in this work, there are the branches:

https://github.com/neondatabase/prisma-engines/tree/skyzh/wasi https://github.com/neondatabase/prisma/tree/skyzh/prisma-wasm

There are many todos in the current codebase but it compiles and just works. Part of the work is based on the current js-driver and therefore it does not provide full data type support as the js-driver only supports few of them. I'm currently cleaning up the codebase and writing some docs about the refactor plans. It would be good if I can help on the WASM thing and get some code merged to this repo.

skyzh avatar Jul 19 '23 20:07 skyzh

@skyzh Exciting contributions, thank you! 🙌🏼 We will reach out to you with feedback soon.

miguelff avatar Jul 20 '23 08:07 miguelff

Very excited about this

A WASM release would make it possible to use Prisma on edge environments and also make Docker image creation much easier, you could bundle all your code in a single file and copy it into your Dockefile

remorses avatar Jul 28 '23 17:07 remorses