

V8 is faster than GCC - wingo
http://wingolog.org/archives/2011/06/10/v8-is-faster-than-gcc

======
cloudhead
I 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
I just ran it, fib is roughly six times faster

~~~
krakensden
recursive 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.

~~~
aidenn0
There is no O(1) fib.

~~~
andreyf
[http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.ht...](http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.html)

~~~
thesz
It contains n-th power. So it is O(logN).

~~~
davidtgoldblatt
In fact, since the fibonacci sequence grows as O(phi^n), we need O(n) digits
to hold the n'th fibonacci number, so the fastest possible algorithm to
compute the n'th fibonacci number must run in time Omega(n).

~~~
T-hawk
Not necessarily if you can parallelize computing the digits. Your average
Pentium processor can compute a floating-point number with a mantissa of 16
decimal or 52 binary digits in one clock cycle, not 16 or 52. It does so by
using enough silicon to compute them all in parallel.

~~~
aidenn0
That's only a constant factor improvement. What if you want to calculate 104
binary digits?

------
pcwalton
This 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
Link-time optimization is almost never useful.

------
PassTheAmmo
How about trying a benchmark that mimics an actual program that someone would
use.

------
strmpnk
Obscure? 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
> 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
Fair 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.

------
hammerdr
In 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.

------
st3fan
Yay! Another useless benchmark!

------
neuroelectronic
No kidding.

------
d0vs
What.

------
nickik
Every 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 :)

