@bartlomieju: Following up on our exchange, I would offer to write a POC for js2wasm integration into v8x.
Being an ahead-of-time compiler the expectation would be a smaller footprint and higher performance than QuickJS, allowing for denser packing and reduced runtime costs per function call. WebAssembly would add isolation ideal for a multi-tenant setup.
After looking into it, the idea would be to compile TypeScript to WebAssembly directly, then precompile the .wasm module with Wasmtime to .cwasm for small footprint and fast cold starts and then measure the shared runtime and per instance footprint and performance compared to QuickJS. For even smaller footprint the IR could also be lowered to a native target, but WebAssembly's module sandbox is ideal for multi-tenant setups.
Would that fit into your vision for v8x and how big is the current footprint and performance with QuickJS compared to V8? Are you running native QuickJS or a Wasm build and how do you isolate tenants from each other?
@bartlomieju: Following up on our exchange, I would offer to write a POC for js2wasm integration into v8x.
Being an ahead-of-time compiler the expectation would be a smaller footprint and higher performance than QuickJS, allowing for denser packing and reduced runtime costs per function call. WebAssembly would add isolation ideal for a multi-tenant setup.
After looking into it, the idea would be to compile TypeScript to WebAssembly directly, then precompile the .wasm module with Wasmtime to .cwasm for small footprint and fast cold starts and then measure the shared runtime and per instance footprint and performance compared to QuickJS. For even smaller footprint the IR could also be lowered to a native target, but WebAssembly's module sandbox is ideal for multi-tenant setups.
Would that fit into your vision for v8x and how big is the current footprint and performance with QuickJS compared to V8? Are you running native QuickJS or a Wasm build and how do you isolate tenants from each other?