How fast is WinterJS vs alternatives? Blazing-fast
Exploring the most performant Service Workers Javascript server to date
Syrus Akbary
Founder & CEO
November 1, 2023
In the WinterJS announcement a few days ago there was some public skepticism on what we meant by blazing fast. This kind of terminology is mostly used for marketing proposes, so it’s completely understandable to be skeptic when no proof was provided.
But when we said blazing fast we were not joking… WinterJS is able to handle 100,000 reqs/sec in a single laptop without breaking a sweat.
In this article we will analyze WinterJS vs the alternatives: workerd and miniflare (check reproducible benchmarks). We would love to compare it with other WinterCG implementations, but unfortunately there aren’t many viable open-source alternatives.
Running a simple Service Worker server with WinterJS (Native) is up to ~3x faster than with workerd and 50x faster than miniflare.
Note that in this benchmark we are running an incredibly simple workload
simple.js
What about WASIX?
One of the strong points of WinterJS is that is compilable to WASIX so it can run fully (without any extra dependencies) in Wasmer.
Here we have the comparison… beware that you may be surprised of the awesome performance!
Note: complex workloads will run likely run slower in WinterJS WASIX since there’s no JIT there. We chose a simple example to showcase the capabilities of WASIX instead of focusing on the performance of JS in Wasm
As we can see, WinterJS running in WASIX is gearing up to 18,000 reqs/sec, which is impressive since we have spent no time on optimizations on the Wasm side (yet).
However, this benchmarks are fairly biased since we are running a workload which does very little JS computation cycles.
Let’s try now running a more realistic complex workload with WinterJS (Natively vs WASIX):
Note that in this benchmark we are running a complex example doing SSR with React
complex.js
(weighting around 580 KB)
So, why it’s slower running a complex workload?
Unfortunately JavaScript can’t be currently JIT’ed when running inside Wasm. That means that Javascript is mainly interpreted when running in a WebAssembly context, and this shows when running workloads that are heavy on the compute side.
We will publish soon an article analyzing different strategies that we can use to speed up JavaScript even more when running inside of Wasm.
In summary: WinterJS is blazing-fast when compared to alternatives!
We hope you enjoyed reading this article and that you become as excited as we are in our quest of bringing JS Service Workers to it’s maximum speed. Lets brake some records!
Follow the project in GitHub: WinterJS in Github.
By creating WinterJS we are aiming to move our website Next.js frontend from Vercel into Wasmer Edge and save tons of $ on the process :)
Stay tuned for more updates!
About the Author
Syrus Akbary is an enterpreneur and programmer. Specifically known for his contributions to the field of WebAssembly. He is the Founder and CEO of Wasmer, an innovative company that focuses on creating developer tools and infrastructure for running Wasm
Syrus Akbary
Founder & CEO
What about WASIX?
Read more
wasmerwasmer edgerustprojectsedgeweb scraper
Build a Web Scraper in Rust and Deploy to Wasmer Edge
RudraAugust 14, 2023
wasmer runtimejavascriptwasmer-jsbrowser
Introducing the new Wasmer JS SDK
Michael BryanDecember 13, 2023