Performance of uWebSockets.js in Bun #931
-
Which should have better performance, using |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
The problem with JavaScript is that it is a script. So any abstraction adds runtime cost. Right now Bun exposes (only) a Fetch-style JS API with Request and Response objects, which obviously is more abstract (GC) than the function-only interface of uWS.js (non-GC). |
Beta Was this translation helpful? Give feedback.
-
They should expose the same API as uWS for Http/ws. They don't even have basic settings working, no progress on issue I opened oven-sh/bun#2988 idleTimeout doesn't work I will try import uWS into Zig and code server in Zig next, nice low level language |
Beta Was this translation helpful? Give feedback.
-
Both Is it also true for |
Beta Was this translation helpful? Give feedback.
-
Sorry for additional question in this topic, But does switching to bun will give us better performance? Node has serious amount of libraries, that don't work with bun. Is it really worth the change? |
Beta Was this translation helpful? Give feedback.
-
It's your task to solve your problems, in whatever way, using whatever tools you decide to use. Nobody is going to decide for you, that's not part of this project. |
Beta Was this translation helpful? Give feedback.
Now, I once tried to benchmark the performance of
node.js
&bun.sh
.Tested using
autocannon
.Tested on my 8-year old laptop having 2-core 2GB RAM with
Windows10
installed and runningResults -
These are tested at 23% Cpu Usage & 65% Memory Usage on idle.
Code -