Live data from Hacker News

Compiled JavaScript with NectarJS can be faster than Node.js and C

blog.seraum.com

11–20 of 30 posts

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#11
post #4

That the C code is compiled with "gcc -O7" tells me just about everything I need to know about the soundness of these experiments. "-O3" and "-Ofast" are the highest optimisation levels, where "-Ofast" includes optimisations that break some standard-compliant programs (mostly -ffast-math). Not to mention that comparing running times for a single run on an unspecified machine isn't "benchmarking".

Yeah, it's hardly a benchmark. The information what kind of CPU they are using is also missing (why no -march=native?).

Despite how unbelievable it looks, I would love to see contents of the final binary to see what is really happening there. gcc code looks quite alright in this case: https://godbolt.org/g/R6iBup

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#12
post #7

gcc should just add a 'remove fibonnaci' optimisation pass, that just optimises this away entirely, and stop people using this benchmark. This is one of the stupidest things I've ever heard of -- I'm going to be really mean now. They want me to use a compiler remotely, every time I want to recompile? So if their servers go down, or my internet connection goes down, I can't even run my compiler? And they have all the…

gcc already optimises away loops like for (i = 0; i It wouldn't be too much of a stretch to detect and optimise away code that computes linearly recurrent sequences.

gcc removes recursion in that case: https://godbolt.org/g/R6iBup

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#13

gcc should just add a 'remove fibonnaci' optimisation pass, that just optimises this away entirely, and stop people using this benchmark. This is one of the stupidest things I've ever heard of -- I'm going to be really mean now. They want me to use a compiler remotely, every time I want to recompile? So if their servers go down, or my internet connection goes down, I can't even run my compiler? And they have all the…

Maybe they've never heard of the Community vs. Enterprise licensing schemes before.

Also, I find it amusing that they think compilation is an attractive feature to people on RasPis and smartphones, when those devices can already just directly run JS. If this worked (which I'm still not convinced of), it would really only be of use to high-performance server writers.

edit: also, iirc, Haskell can reduce out a fibonacci sequence if you pass it a constant

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#16

gcc should just add a 'remove fibonnaci' optimisation pass, that just optimises this away entirely, and stop people using this benchmark. This is one of the stupidest things I've ever heard of -- I'm going to be really mean now. They want me to use a compiler remotely, every time I want to recompile? So if their servers go down, or my internet connection goes down, I can't even run my compiler? And they have all the…

My production-ready PHP-to-JS compiler pragmatically optimises for highest efficiency in real-world synthetic benchmark scenarios by only being capable of compiling the factorial function.

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#17

"Compiler as a Service" I think that says enough about this project unfortunately. Why would I want to compile aanything, specifically JavaScript, "in the cloud"?! Also, "Tail recursion optimisation as a service"?

Subscribe for debug build feature just for $99.99/month!

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#18
Compiler-as-a-service is certainly disappointing.

He should benchmark vs the nexe [1] and (commercial) EncloseJS [2] JavaScript compilers (both grabbing V8's untraced/unoptimized initial translation to x86_64 as I understand).

[1]: https://github.com/nexe/nexe

[2]: http://enclosejs.com/

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#20
post #4

That the C code is compiled with "gcc -O7" tells me just about everything I need to know about the soundness of these experiments. "-O3" and "-Ofast" are the highest optimisation levels, where "-Ofast" includes optimisations that break some standard-compliant programs (mostly -ffast-math). Not to mention that comparing running times for a single run on an unspecified machine isn't "benchmarking".

"Faster than C" will be bogus 99.9% of the time no matter how fake or stupid your "benchmark" is.
Post reply on HN