Re:Box2d Revisited
by evmar on Thursday April 25, 2013 @07:37PM
(#5610654)
I'm curious whether the performance varies if you used a C compiler from the last five years -- GCC 4.2.1 was released in July 2007. (I'm not claimed the author of the post is unfairly biasing the results, I'm just honestly curious.)
[ Parent
| on HN ]
To answer my own question, I got:
gcc 4.6.3: 3.554688 +/- 4.786550
clang trunk: 3.593750 +/- 4.798172
Chrome: 41.03515625 +/- 9.331709130062185
Which puts Chrome at about 11x these native compilers, consistent with the blog post. gcc 4.8.0: 1.640625 +/- 3.703323
clang 3.2: 1.718750 +/- 3.772718
chrome : 23.28515625 +/- 3.636932727324763
So chrome is about ~14x the native compilers.Changing gcc to use -O2 instead of -O3 gets: 1.562500 +/- 3.630922.
Re:Box2d Revisited
by gillianseed on Thursday April 25, 2013 @11:14PM
(#5611292)
What about -Ofast which enables -ffast-math?
The makefile supplied with the repo specifies -ffast-math. It uses these CFLAGS:
CFLAGS=-s -O3 -msse -mfpmath=sse -ffast-math -fomit-frame-pointer -IBox2D_v2.2.1 -DNDEBUG=1
Using -Ofast gets the same results as -O2.
Re:Box2d Revisited
by gillianseed on Friday April 26, 2013 @09:27AM
(#5612750)
Thanks for the info, I should have guessed that he enabled -ffast-math manually.
Re:Box2d Revisited
by joelgwebber on Thursday April 25, 2013 @08:05PM
(#5610749)
FWIW, I just ran it through Clang 4.1 (the standard on XCode these days), and got roughly identical performance. I'm still compiling gcc 4.8 just to be sure, but it seems unlikely to make much of a difference.
There's no Clang 4.1, though. You probably mean "the Clang that comes with version 4.1 of XCode"?
Clang 3.3 will be released soon.
Re:Box2d Revisited
by joelgwebber on Thursday April 25, 2013 @09:20PM
(#5610965)
Good point. Apple helpfully reports the rather confusing version string "Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn)" :P
Re:Box2d Revisited
by joelgwebber on Thursday April 25, 2013 @08:25PM
(#5610815)
Ditto for gcc-4.8. Roughly the same (ever so slightly worse) performance.