News for hackers. Stuff that matters.
Re:V8 is faster than GCC by cloudhead on Friday June 10, 2011 @03:43PM (#2642153)
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.
Re:V8 is faster than GCC by nicklovescode on Friday June 10, 2011 @04:07PM (#2642223)
I just ran it, fib is roughly six times faster
Re:V8 is faster than GCC by krakensden on Friday June 10, 2011 @04:31PM (#2642295)
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.

Re:V8 is faster than GCC by aidenn0 on Friday June 10, 2011 @05:43PM (#2642525)
There is no O(1) fib.
Re:V8 is faster than GCC by andreyf on Friday June 10, 2011 @05:46PM (#2642536)
Re:V8 is faster than GCC by aidenn0 on Friday June 10, 2011 @05:59PM (#2642576)
Calculating that formula is not O(1), unless you have a way of calculating exponentiation, multiplication and subtraction all in O(1) time.

A closed form does not O(1) make

Re:V8 is faster than GCC by thesz on Friday June 10, 2011 @06:00PM (#2642578)
It contains n-th power. So it is O(logN).
Re:V8 is faster than GCC by davidtgoldblatt on Friday June 10, 2011 @07:08PM (#2642740)
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).
Re:V8 is faster than GCC by T-hawk on Saturday June 11, 2011 @12:31AM (#2643211)
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.
Re:V8 is faster than GCC by aidenn0 on Thursday June 16, 2011 @01:12PM (#2662191)
That's only a constant factor improvement. What if you want to calculate 104 binary digits?
Re:V8 is faster than GCC by ddlatham on Friday June 10, 2011 @05:58PM (#2642573)
Re:V8 is faster than GCC by nicklovescode on Friday June 10, 2011 @05:01PM (#2642397)
I couldn't determine which was the best, so I just calculated by hand instead
Re:V8 is faster than GCC by ldng on Friday June 10, 2011 @05:47PM (#2642538)
Andy Wingo knows quite well what he's doing. It's just a fun post. Read his 2/3 previous posts if you want more serious stuff on V8.
Re:V8 is faster than GCC by pcwalton on Friday June 10, 2011 @01:58PM (#2641783)
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".

Re:V8 is faster than GCC by rayiner on Friday June 10, 2011 @07:09PM (#2642741)
Link-time optimization is almost never useful.
Re:V8 is faster than GCC by PassTheAmmo on Friday June 10, 2011 @02:42PM (#2641981)
How about trying a benchmark that mimics an actual program that someone would use.
Re:V8 is faster than GCC by strmpnk on Friday June 10, 2011 @02:02PM (#2641800)
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?
Re:V8 is faster than GCC by rcfox on Friday June 10, 2011 @04:43PM (#2642337)
> 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?

Re:V8 is faster than GCC by strmpnk on Friday June 10, 2011 @04:52PM (#2642361)
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.
Re:V8 is faster than GCC by hammerdr on Friday June 10, 2011 @10:46PM (#2643092)
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.

Re:V8 is faster than GCC by st3fan on Friday June 10, 2011 @10:00PM (#2642998)
Yay! Another useless benchmark!
Re:V8 is faster than GCC by neuroelectronic on Friday June 10, 2011 @06:07PM (#2642605)
No kidding.
Re:V8 is faster than GCC by d0vs on Friday June 10, 2011 @03:40PM (#2642136)
What.
Re:V8 is faster than GCC by nickik on Friday June 10, 2011 @03:14PM (#2642060)
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 :)