Live data from Hacker News

We've been lied to: JavaScript is fast

jyelewis.com

1–10 of 86 posts

Re: We've been lied to: JavaScript is fast

#2
I've never heard anyone tell me that JavaScript is slow.

I remember node.js benchmarks in the front page of hn showing it to be as fast as hotspot jvm. And this was pre 2012.

And since node is single threaded, you had to run n.cores instances of your app.

For the longest time as a kid what I was lied to was that Java was much slower than Ruby/Python and my perception was painted by the startup times.

Re: We've been lied to: JavaScript is fast

#4
There are many things to consider in addition to just JS, like bloated frameworks, dependency hell, startup times... yeah a single benchmark may not show much difference, but when you consider everything else there is a noticeable difference between a JavaScript CLI app and Go/C CLI app.. I can visibly even see a difference for CLI, but my process manager clearly shows any desktop GUI use for JavaScript is severely less performant than most native counterparts.

Re: We've been lied to: JavaScript is fast

#6

There are many things to consider in addition to just JS, like bloated frameworks, dependency hell, startup times... yeah a single benchmark may not show much difference, but when you consider everything else there is a noticeable difference between a JavaScript CLI app and Go/C CLI app.. I can visibly even see a difference for CLI, but my process manager clearly shows any desktop GUI use for JavaScript is severely l…

Super true, and JS frameworks haven't always been kind on their CPU usage (cough AngularJS).

I think desktop GUI apps also have browser rendering engines chewing resources.

Re: We've been lied to: JavaScript is fast

#7
post #3

Yes but. https://dev.to/jaredcwhite/the-shocking-immaturity-of-javasc...

I don't know that I agree with this article, while there is absolutely a problem with package/framework/build tools churn that makes development super painful, I don't feel that developing with JavaScript has been any more painful than developing with VB, C#, PHP etc was in the past.

All languages have their pain points, and modern JS/TS, while undisputably having their quirks, aren't particularly more quirky than JS (IMHO)

Re: We've been lied to: JavaScript is fast

#8
In the past when I have written basic benchmarking code like the first example, the compiler will typically optimize all the code away.

I am curious why this did not happen or what optimization flags were passed in.

If it was prevented optimization through flags, is this a fair test?

Re: We've been lied to: JavaScript is fast

#9

In the past when I have written basic benchmarking code like the first example, the compiler will typically optimize all the code away. I am curious why this did not happen or what optimization flags were passed in. If it was prevented optimization through flags, is this a fair test?

For lower numbers this completely optimizes away for me too, but after a certain point the loops stays in place (with no flags)
Post reply on HN