Compiled JavaScript with NectarJS can be faster than Node.js and C
1–10 of 30 posts
Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#2Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#3This 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 source code I've ever compiled?
And their evidence for their amazing super-awesome compiler is... optimising fibonnaci? Which their compiler (any compiler) could easily be detecting and special-casing? (I'm surprised more don't actually).
Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#4Not to mention that comparing running times for a single run on an unspecified machine isn't "benchmarking".
Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#5I 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"?
Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#6gcc 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…
This is not a benchmark on any regard. I thought we were past the stage of optimizing to specific microbenchmarks and then showcasing those.
If you're not going to show me real performance, at least show me Octane https://chromium.github.io/octane/ or something similar.
Finbonacci is utterly meaningless. Here, my language does Fibonacci(45) in 0.001 seconds, it compiles any output to the python code `print 1134903170`.
Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#7gcc 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…
Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#8And what is -O7 level? Or, better, O7 lvl? :) Dynamic version of 45th fibonacci number (see http://www.geeksforgeeks.org/program-for-nth-fibonacci-numbe...) has the following runtime:
ᐅ gcc -O2 fib.c -o fib && time ./fib
1134903170
./fib 0.00s user 0.00s system 49% cpu 0.005 totalRe: Compiled JavaScript with NectarJS can be faster than Node.js and C
#9Or, the code gets tail recursion optimized, turned into an iterative solution whilst the c code is recursive? If it was doing the same thing its unlikely to be faster.
However, this "benchmark" is totally dominated by function call overhead, and it's quite conceivable that you can engineer your compiler to optimise for that case at the expense of others. You could do it quickly enough by unrolling the recursion a few times. This can cause the code to balloon in size in the general case, but not for this simple case.
It's also not particularly impressive to optimise a Javascript program that does not exhibit any complex behaviour. Again, you can just write a compiler that detects whether the Javascript program is straightforward, and if so, turns it into C or whatnot. Without being able to see what the compiler is doing, there is no way to know.
Also, "Compiler as a Service" may be a good idea for some cases (like farming an aggressively optimising but very slow compiler off to the cloud), but as the default case? No way.
Re: Compiled JavaScript with NectarJS can be faster than Node.js and C
#10NodeJS already is fast, and if one really needs something faster maybe use something else than javascript?