You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After adding multiple polyfills like TextEncoder and TextDecoder, the JavaScript shims library started to grow. Currently, it's about 1.1Mb (850Kb minimized). This is causing the JS requests to take ~100ms.
Describe the solution you'd like
I would like to precompile the polyfills so we eval the bytecode directly. This should improve the performance as the JS runtime doesn't need to parse and compile the polyfill over and over. To compile source code to bytecode, the Javy toolchain already provides different methods:
Is your feature request related to a problem? Please describe.
Currently, we're appending the source code into the polyfill and compiling it on every request:
wasm-workers-server/kits/javascript/src/main.rs
Lines 85 to 98 in c3a4aa9
After adding multiple polyfills like
TextEncoder
andTextDecoder
, the JavaScript shims library started to grow. Currently, it's about 1.1Mb (850Kb minimized). This is causing the JS requests to take ~100ms.Describe the solution you'd like
I would like to precompile the polyfills so we eval the bytecode directly. This should improve the performance as the JS runtime doesn't need to parse and compile the polyfill over and over. To compile source code to bytecode, the
Javy
toolchain already provides different methods:To store the bytecode, we can use the
wizer
to preinitialize and save it in a global variable.Describe alternatives you've considered
For now, this is the only alternative I found to improve the runtime performance.
Additional context
No response
The text was updated successfully, but these errors were encountered: