Ah microbenchmarks, we meet again. (This refers to Bun vs Node only)
Basically my understanding is:
- Bun uses JavaScript core and Node uses V8. They’re a bit different, no clear winner.
- Node is bloated for historical reasons, or has an extensive stdlib, depending on your perspective
- Bun uses uWebSockets which is a C++ built purpose built low-memory HTTP1.1 event loop based web server that is extremely fast (and reliable). Credit for speed should go to them, for http at least
- You can just use uWebSockets with Node if you want, it will be roughly equivalent
- Bun otoh does not support HTTP2 but “they’re working on it”, but nevertheless this is a huge feature blocker and depending on the implementation you may see major performance regressions (uWebSockets are not currently planning to implement http2 afaik, which means they have to use http2 as implemented by a mortal instead)
Overall, I think Bun should stop promoting microbenchmarks (but whatever, marketing is what it is) and focus on their real innovation value: a single-tooling simplified and modern server-side JS environment. This is already compelling. If they insist on benchmarking, why not build a standard crud app with Postgres/SQLite, put it behind nginx with ssl and compare there instead? The difference won’t be that big.
Yes. I don't know where this obsession over making JS fast comes from, considering most web applications are http glue code to a database server and spend most of time waiting on I/O
Biggest selling point of Bun is the potential it has to empty my node modules directory and free my mind of worries about supply chain attacks.
Not scoffing, performance is nice to have. I really like how Bun replaces all development tools, is much faster for package management and bundling. The fast startup is also a bonus and means it could be used for writing command line tools.
However, as a server side runtime it doesn't matter much because the time spent on those libraries is minimal in compared to the time spent waiting for I/O
Basically my understanding is:
- Bun uses JavaScript core and Node uses V8. They’re a bit different, no clear winner.
- Node is bloated for historical reasons, or has an extensive stdlib, depending on your perspective
- Bun uses uWebSockets which is a C++ built purpose built low-memory HTTP1.1 event loop based web server that is extremely fast (and reliable). Credit for speed should go to them, for http at least
- You can just use uWebSockets with Node if you want, it will be roughly equivalent
- Bun otoh does not support HTTP2 but “they’re working on it”, but nevertheless this is a huge feature blocker and depending on the implementation you may see major performance regressions (uWebSockets are not currently planning to implement http2 afaik, which means they have to use http2 as implemented by a mortal instead)
Overall, I think Bun should stop promoting microbenchmarks (but whatever, marketing is what it is) and focus on their real innovation value: a single-tooling simplified and modern server-side JS environment. This is already compelling. If they insist on benchmarking, why not build a standard crud app with Postgres/SQLite, put it behind nginx with ssl and compare there instead? The difference won’t be that big.