BUN - Supersonic NodeJS drop-in replacement
Captured from (https://bun.sh/blog)

BUN - Supersonic NodeJS drop-in replacement

Bun is one of the most prominent javascript tools right now. Imagine if you could run a javascript/typescript script at least 2x or 4x faster in some workloads with a fraction of the resources!? Yep, that's possible...

Bun is a supercharged JavaScript and TypeScript runtime that covers ~90% of Nodejs API written in ZIG that features some advantages to traditional Nodejs and Deno runtimes:

  • Faster application startup
  • Faster running performance
  • Cohesive DX (bundler, transpiler, and package manager)


Take these examples compiled by me:

console.log(1+1)        
N?o foi fornecido texto alternativo para esta imagem
console.log example, at least 2.20x faster than nodejs
function fibonacci(n) {
? if (n <= 1) {
? ? return n;
? } else {
? ? return fibonacci(n - 1) + fibonacci(n - 2);
? }
}


let result = fibonacci(40);
console.log(result);        
N?o foi fornecido texto alternativo para esta imagem
Fibonacci with 40 interactions 1.57x faster than nodejs

Ok, that's neat, now what?

Start to think about how much performance per $ you would get in your JS/TS lambdas, microservices, build times, and the snappier experience your API's would provide to the user. For you as a DEV, some API's need to be refactored to support BUN's, but not much.


It handles 1 Million WebSocket messages per second (That's brutal...)

N?o foi fornecido texto alternativo para esta imagem
WebSocket Chat example from (https://bun.sh/)

Give it a spin, and cheer up the project:

curl -fsSL https://bun.sh/install | bash        

要查看或添加评论,请登录

社区洞察

其他会员也浏览了