DEV Community

Cover image for A first look at Bun: is it really 3x faster than Node.js and Deno?

A first look at Bun: is it really 3x faster than Node.js and Deno?

Steve Sewell on August 26, 2022

Love it or hate it, the JavaScript tooling landscape is the subject of a lot of chatter yet again. The latest: Bun. A new JS runtime focused on pe...
Collapse
 
bsmirh profile image
Bill Haack

Not ideal for whom? Some of us like that kind of work environment. You act as though there is some ethical code is being violated. Is there a new ethic against hard word and long hours now? I missed that memo.

 
zakharsmirnoff profile image
Zakhar Smirnoff

No one forces you to sign an agreement, lol. The conditions are transparent and known beforehand.

According to your logic, it’s not ok for banks to issue loans since they just steal your money. You took from them 100 USD, but you owe them 110 USD. That’s definitely a deceive, I think we should sue them. F*ck the agreement, we will just tell them the logic of Luke Shiru.

Collapse
 
ivictbor profile image
Ivan Borshchov • Edited

It is an awesome tweet for a company which have all chances to influence the future. Same to "There are way easier places to work, but nobody ever changed the world on 40 hours a week""

Collapse
 
_4 profile image
Eran Or

Well, Brendan Eich changed the world in 10 days with JavaScript.

Thread Thread
 
ivictbor profile image
Ivan Borshchov
 
eezing profile image
Eric Zingeler • Edited

Work ethic(s), there’s irony here. It’s not a company, it’s a startup, I’m sure equity is part of the package.

 
zakharsmirnoff profile image
Zakhar Smirnoff

I don't understand. If overtime hours are paid and you signed an agreement which is clearly saying that sometimes you would stay overtime and get paid for that. Where is the problem?

Collapse
 
christian_go3 profile image
Christian GO

Thanks for sharing Steve, I will definitely keep an eye on Bun!

 
joaovictorvp profile image
João Victor VP - N

Calm down, the friend there didn't say that there is no exploitation nor did he make any absurd point. Exploitation certainly exists in large corporations, but that doesn't mean overtime is exploitative, you're just looking at things from the employee's side when the dance is two-way, the programmer is not obligated to work at that company if he doesn't want to. in no way do overtime, and that is specifically why it is not exploitation, or at least, it is not unwarranted or negative exploitation per se. Things would be different if we were talking about people like Beezos for example, they are cases and cases that need to be analyzed. It also doesn't mean he thinks these extra hours are cool or that he's not being "empathetic to other devs", just that he's considering all facets of this issue.

 
zakharsmirnoff profile image
Zakhar Smirnoff

Okay, I would choose my friend. What about 100k loan for opening up my new business? Would a friend give me this amount of money? If yes (because I don't know about your friends, mine are not that rich), then are you 100% sure, that your friend would not expect a share in your business or at least some percent off 100k, say 2-3%? Money is not free, your friend could choose a deposit in the bank or buy Tesla shares or else.

Let me point this out: no one in the comment section or in the actual post tried to shill Oven job to you or anyone else. Let's just admit: YOU started the thread about their work culture, and now you are complaining that someone might have recommended this job to you.

If you don't recommend the job, it's totally fine. That's your opinion. But there are other people with their opinions who think it's totally fine to work there. Again: it's totally legal, so no one should worry about. Just DYOR about the company and make your own choice. It's like you are trying to ban this company just because you don't like it. Well, if you don't like it, don't work there. It's that simple, yes

 
joaovictorvp profile image
João Victor VP - N • Edited

If I had a company and I needed my employees to work more than the established hours, I would ask them, and if it was within my power, I would reward them properly for their effort. Of course what I would do is not what you would do, or what this company did, I am not approving or disapproving of their behavior but simply pointing out that this is not an exploratory act per se and that it may actually be justifiable depending on of the circumstances.

 
arden144 profile image
Arden

Mandatory overtime isn’t exploitation. Nobody is being forced to work there, and it’s not slave labor. Some devs want the extra money from working overtime.

 
joaovictorvp profile image
João Victor VP - N

This was not a fallacy, what I brought was the lack of ability to analyze the state of affairs from an objective point of view due to a lack of practical experience in the world. You can certainly complain and find a country's environmental or political problems horrific, but do you have the capacity to say that you have a solution to the problems it presents? That's a paramount point (and I'm not saying anyone even has these answers, doesn't they). Of course we can talk about things that we have no experience with, but that doesn't mean we should be blind to the set of things we don't really know, you don't really know the difficulty of "just hiring one more dev" and clearly you don't understands the fact that "just don't hire someone" is nowhere near the solution to any problem, so my point was that your statement was empty in itself, if you lack real knowledge about something then most likely your statements about that something will be addicted to whatever ideological or pre-established views you may have had before. Of course, if you think I'm wrong, feel free to answer me, but don't reduce my points to mere fallacies.

Collapse
 
arden144 profile image
Arden

Oven is one person. He’s trying to start a business and setting expectations is perfectly valid. If someone isn’t willing to work long weeks, then surely they won’t work there.

Collapse
 
tamusjroyce profile image
tamusjroyce

When it gets stable, deno will switch to webkit javascript core too. very shortly deno will have full npm support. so why not stick with what is stable. And it will get drastic stable speed increases going forward

But I do wish bun the best of luck for quick stability. deno needs this speed improvement too.

No one needs really needs the bun language. doesn’t seem like rust motive for security & stability (took me a while to think about rust over C)

 
eezing profile image
Eric Zingeler

Some may not see it that way and they’ll be the ones to apply. Is it not a good thing that the company disclosed their expectation publicly?

 
joaovictorvp profile image
João Victor VP - N

Have you ever come even remotely close to opening a company in your life?

Collapse
 
seanpietz profile image
sean pietz

There is nothing remotely wrong with a startup having passion-driven hard work as company value. And your argument makes no sense - if people want to become part of a company that shares their values, what is wrong or exploitative about that. If you're making a Marxist argument about capitalism being exploitative in and of itself then make that argument, and I'd take you much more seriously. Are there any values that a for-profit startup is allowed to have that aren't exploitative? What if they said they were "committed to social justice and if you arent then it's probably the wrong company for you", would that be problematic for you? What is your actual argument, are you against hard work (i.e. pro laziness), or against capitalism in general, or both? Which would be more exploitative and immoral: 1. A startup where everyone passionately works really hard and as a result everyone gets rewarded with company equity and fulfillment, or 2. A startup where everyone apathetically works 25 hours a week and all end up poor and/or unemployed (I'm not posing this as a necessary dichotomy, I'm just curious to know your answer for this particular hypothetical case).

Collapse
 
kostyfisik profile image
Konstantin Ladutenko

Bun is in beta, so... Have you considered using experimental HTTP server from deno, they're claiming it to become 3x faster? deno.com/blog/v1.25#new-experiment...

Collapse
 
steve8708 profile image
Steve Sewell • Edited

Ya! Latest benchmarks use that github.com/BuilderIO/framework-ben.... Note tho that what they optimized was the HTTP server, but this tests the performance of a full application which will mostly be impacted by the other business logic and react components rendering. That said tho Deno moved up a bit from the latest beta server

Collapse
 
kostyfisik profile image
Konstantin Ladutenko • Edited

Sorry, I am still a bit confused. Could you please share results both for Deno 1.25 in normal and experimental mode? If I got you right, using smth like real-world-app shows no performance gain. May be this is due to the fact, that in experimental mode Deno is only capable of http/1.1, which is not important for hello world app... and it still outperform http/2 web server for a full fledged app...

Thread Thread
 
steve8708 profile image
Steve Sewell

Here are the results before and after - before is on (I believe) Deno 1.24, after is on Deno 1.25 with experimental mode github.com/BuilderIO/framework-ben...

But what I’m trying to say is the server speed is not usually the main bottleneck for a real world application. Most CPU cycles are spent on the business logic of the application, rather than the details of the server implementation

Thread Thread
 
steve8708 profile image
Steve Sewell

All that said all of the code is open source so you are more than welcome to replicate the results yourself too in any way you like and/or send PRs for feedback and improvements

Thread Thread
 
kostyfisik profile image
Konstantin Ladutenko

Deno and Bun are almost twice as fast as Node for your app... with no change in business logic for all cases. So your results do not support the claim, that "Most CPU cycles are spent on the business logic". Is it possible somehow to profile, where main CPU power really goes?

Collapse
 
bacloud22 profile image
aben • Edited

I'm curious to see these benchmarks being done over network, and preferably from different clients over seas across the globe, with every connection available.

You will see then that the biggest factor is old same old in the context of a "website", it is NETWORK assuming you are running your threads in best practices, like no blocking loop and doing parallelism, these are assured by design in programming languages and by web servers already, like just don't block the event loop (in node) and don't block when requesting your data from files or DB and stuff like that,
You will soon find that these differences play really a little in business,
You can always use CGIs by the way ! and plain files instead of DBs etc, you will probably get faster servers, but at what cost ?! This is to mention, the real deal is not running plain code on bare metal and benchmarking that in that same process or machine. and this is exactly what I'm seeing about 99% of benchmarks !
People still use PHP and I guess it does work great for them.

Developers are using NodeJS because it is faster and safer JavaScript, and JavaScript is easy or has been well adopted by large, that's it;

Collapse
 
bacloud22 profile image
aben • Edited

Like the Rust and Go fever, nearly no need for a regular website, that does go back and forth between a database and the most sophisticated algorithm that could use is a Radix Trie, some CSS and animations in the front and the client is more than happy.

Collapse
 
adzetko profile image
Maxim "Adzy" Hohengarten

I tend to consider these work practices to be self-destructive (I don't actually have any proof what I say, and just the unethical part of such claims should suffice). I wouldn't put my trust into the long term support of a product made by a company with a self-destructive behaviour.

However, as I'm pretty new to JS runtimes, I didn't knew about Deno, so as this whole post put the spotlight on it, I'll definitely look forward to it!

Collapse
 
mr_superhaggis profile image
Nick Winfield

Will definitely be keeping an eye on this runtime - a drop-in replacement is a no-brainer and the benchmarks thus far are very favourable. Confident the company behind it will deliver once they do the necessary crunching required to get it over the line.

 
staidwinnow profile image
Staid Winnow

I mean, I am open to any opinions that earn respect. One that attempts to justify corporations demanding free labor is not one of those.

Collapse
 
baturdev profile image
Batur Akkurt

Hi, I tried to create the next.js app with bun last week but it doesn't work correctly. Also after creating next.js app w/ bun, the project is not directly compatible with yarn/npm.