GHC vs. GCC on raw vector addition

Bulat Ziganshin bulatz at
Thu Jan 19 03:54:03 EST 2006

Hello John,

Thursday, January 19, 2006, 4:42:47 AM, you wrote:

>> sorry, with the "gcc -O3 -ffast-math -fstrict-aliasing -funroll-loops"
>> the C version is 50 times faster than best Haskell one... it's the
>> loop from C version:

JM> I believe something similar to what I noted here is the culprit:

i mean this when i wrote that jhc must be better. i just forget than
jhc is not yet supports arrays

JM> GHCs indirect calls are really killing its performance in tight loops. I
JM> think there is room for collaboration between the various compilers
JM> there, since we are all moving to a c-- back end (in theory) we could
JM> work on a common c-- -> C translator that searches out such uneeded
JM> indirections and zaps them before they get to gcc which doesn't handle
JM> them well at all.

using your ideas to dramatical speed up simple loops will be very
good. GHC is very good in high-level optimizations, but it simply
ignores the problem of compilation simple imperative-style code

Best regards,
 Bulat                            mailto:bulatz at

More information about the Glasgow-haskell-users mailing list