Skip to content

Performance of uWebSockets.js in Bun #931

Answered by git-matrix
git-matrix asked this question in Q&A
Discussion options

You must be logged in to vote

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 running

  • Microsoft Edge with current discussions page open
  • Visual Studio Code Insiders
  • Microsoft Terminal
  • WSL with Ubuntu-latest installed

Results -

req/sec Cpu Usage Memory Usage
node.js 18k 100% 68%
bun.sh 16k 100% 73%

These are tested at 23% Cpu Usage & 65% Memory Usage on idle.

Code -

if (process.isBun) {
    Bun.serve({
        fetch: async () => {
            return new Response('OK');
        },
        port: 8081
    });
} else {
    const { App } = require("uWebSockets.js");

    App()
        .g…

Replies: 5 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@mtsewrs
Comment options

@e3dio
Comment options

@uNetworkingAB
Comment options

Comment options

You must be logged in to vote
7 replies
@git-matrix
Comment options

@Mupli
Comment options

@uNetworkingAB
Comment options

@git-matrix
Comment options

Answer selected by git-matrix
@uNetworkingAB
Comment options

@git-matrix
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants