[haiku] Re: gcc4 hibryd

  • From: Christian Packmann <Christian.Packmann@xxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Wed, 04 Mar 2009 10:39:22 +0100

Stephan Aßmus wrote:
One other problem with the benchmark is that you didn't only use different compilers, but also different platforms. In another word, running a cygwin 2.95.3 build of your benchmark on Windows would be interesting, comparing cygwin 4 on Windows. Obviously, it would be a punch in the belly if a simple computational benchmark ran twice as fast on Windows compared Haiku, everything else being equal.

This is not really a concern. Pure computational code is just as fast on
both platforms, as my SSE2 code proves. I assumed some mysterious platform difference myself after seeing the GCC differences and didn't trust the results before I had some assembly code as a reference point. I also disassembled the generated GCC code on both platforms to see if there was anything fishy going on, but it's just plain computations.

The difference between GCC2 and GCC4 code we observe lies in the x86 code generator/optimizer of both versions. GCC2 is nearly a decade old, and this shows. The GCC project has been improving their compiler continuously throughout this time, and especially the x86 backend profited from that work - it was really bad in the 2 series, but the 4 series is acknowledged as being one of the best-optimizing x86 compilers around. This is independent of OS version, as the x86 code generator is shared
across all GCC versions on the same CPU architecture.

BTW, these kind of drastic improvements from GCC2->4 as seen on x86 are
not necessarily true for other CPU architectures. The m68k backend in GCC2 was already excellent, it often outperformed the SAS-C compiler on the Amiga - which itself was already pretty wicked. So the m68k version won't have seen any such drastic improvements as we can observe on x86.

> But maybe the
turned off optimizations in our GCC4 indeed account for the missing performance boost, then it could be low hanging fruit to get a boost for GCC4 Haiku in general. :-)

I'm rather certain of that; let's just hope that full optimizations don't break anything. We should see a 50-100% speed increase throughout, and that would be cool.

It would also negate some current deficiencies: e.g. JPG decoding is noticeably slower for really big images on Haiku compared to Windows (comparing ShowImage to XnView). That is on my quad Core2@xxx GHz; on slower machines, this will be noticeable even with rather normal image sizes, e.g. 5MP photos or such. A "true" GCC4 build would remove such disadvantages and level the playing field compared to Windows and Linux.


Other related posts: