8 ms·
V8 is faster than GCC
- pcwalton 15y agoThis is a banal point. Yes, separate compilation hurts performance. But that's what link-time optimization is for. GCC and LLVM alike can both do link-time optimization. You might as well say "gcc with -O0 is slower than V8, therefore V8 is faster than gcc".
- rayiner 15y agoLink-time optimization is almost never useful.
- strmpnk 15y agoObscure? It's interesting but I can't see a case where I'd be recompiling C code every time I want to run something. On the other hand, we can't just go AOT compile using V8 (AFAIK) so let's call V8 always slower?
- rcfox 15y ago> I can't see a case where I'd be recompiling C code every time I want to run something. How about when you're writing a program in C?
- strmpnk 15y agoFair enough, though I'm rarely obsessed with the absolute speed of code while developing. Tools like clang have brought this experience a long way as well.
- PassTheAmmo 15y agoHow about trying a benchmark that mimics an actual program that someone would use.
- nickik 15y agoEvery reader of that blogpost: Oh blabla unfair, the C code of the thing would be faster if the thing had included the other thing blabla. I think its a fun benchmark :)
- d0vs 15y agoWhat.
- cloudhead 15y agoI can't even begin to explain how wrong this benchmark and the author's conclusion is. I'd rather see a benchmark of apache vs a fibonacci function than read this nonsense.
- nicklovescode 15y agoI just ran it, fib is roughly six times faster
- krakensden 15y agorecursive fib, memoized fib, or O(1) fib? Also, given that apache should run indefinitely, I would think the preferred result would be that fib is infinitely faster.
- nicklovescode 15y agoI couldn't determine which was the best, so I just calculated by hand instead
- aidenn0 15y agoThere is no O(1) fib.
- andreyf 15y agohttp://mathworld.wolfram.com/BinetsFibonacciNumberFormula.html http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.ht...
- neuroelectronic 15y agoNo kidding.
- st3fan 15y agoYay! Another useless benchmark!
- hammerdr 15y agoIn my mind, the value of this benchmark isn't to prove that V8 is absolutely faster than C but that there is intrinsic value in doing runtime compilation instead of / on top of compile-time optimizations. It's a demonstration of why run time optimizing compilers/runtimes may one day become faster than compile time optimizing compilers.