gpt4 book ai didi

Is Bun really ~3 times faster than nodejs?(Bun真的比NodeJS快3倍吗?)

转载 作者:bug小助手 更新时间:2023-10-25 22:34:22 26 4
gpt4 key购买 nike



I was looking at Bun Official Site there i noticed that they are claiming, bun is nearly 3 times faster than nodejs.
Is it really true or it is just a marketing strategy to promote bun over nodeJS?

我看了一下Bun官网,我注意到他们声称BUN比NodeJS快近3倍。这是真的吗,还是只是一种营销策略,推广BUN而不是NodeJS?


Bun comparison with nodejs


Please let me know your thoughts.

请让我知道你的想法。


更多回答

This is not the thing to worry about. Bun is only ten months old, isn't particularly established, and has no developers working on it other than Jared. I don't want to be hasty or mean but it sounds like a vanity project, and certainly not something I'd want to use right now. Are you having issues with (apparently) node's inadequate 16K+ HTML request p/s?

这不是要担心的事情。BUN只有10个月的历史,并不是特别成熟,除了Jared之外,没有其他开发人员在开发它。我不想草率或刻薄,但这听起来像是一个虚荣的项目,肯定不是我现在想要使用的东西。你对(显然)Node的16K+Html请求不充分有问题吗?p/S?

uWebSocets in github is 12x faster than NodeJS. So it is possible to be between 12x and 1x. But this speed difference diminishes once the content grows.

GitHub中的uWebSocet比NodeJS快12倍。因此,它有可能在12x到1x之间。但一旦内容增长,这种速度差异就会缩小。

优秀答案推荐

I am trying to do bun install in my CRA react app for checking bun's performance

我正在尝试在我的CRA Reaction应用程序中安装BUN,以检查BUN的性能


bun install v0.1.4
🔍 @sentry/react [1608/1608]

it's maybe faster than node, but I think its not yet ready for everyday/production use.

它可能比Node更快,但我认为它还没有准备好用于日常/生产使用。


maybe I am with WSL (Ubuntu) coz of that its not always working properly for me

也许我用的是WSL(Ubuntu),因为它并不总是适合我



I did quite some comparing between Node und Bun and the results are very mixed. Complex tasks like a huge Webpack project resulted in Node being 10% faster than Bun and express based servers resulted in Bun being 50% faster than Node.
As always: it depends!
What I actually like the most with Bun is btw how easy it is to run TypeScript code ;-)

我对Node和Bun做了相当多的比较,结果非常好坏参半。复杂的任务,如庞大的webpack项目,导致Node比Bun快10%,而基于Express的服务器使Bun比Node快50%。一如既往:视情况而定!实际上,我最喜欢Bun的是它运行打字代码是多么容易;-)



Yes it is true. BunJS is actually faster than NodeJS. I wrote a tree-walk interpreter in JavaScript and ran it using both Node and BunJS. NodeJS took ~1 seconds were as Bun took ~0.73s the first time and even less the second time:

是的,这是真的。实际上,BunJS比NodeJS更快。我用JavaScript编写了一个树遍历解释器,并使用Node和BunJS运行它。NodeJS用时约1秒,而Bun第一次用时约0.73秒,第二次用时更短:


test run for node and bun


In this case, the increase is not much as the code was already quite optimised but for a server, Bun can be exponentially faster.

在这种情况下,增加的不是很多,因为代码已经相当优化,但对于服务器,Bun可以指数级地更快。


更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com