[Haskell-cafe] Re: MD5 performance optimizations, and GHC -via-C producing segfaulting binary

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue May 20 16:01:00 EDT 2008

Hello Andrew,

Tuesday, May 20, 2008, 11:05:52 PM, you wrote:

>> -funbox-strict-fields.

> I did try that, but it didn't seem to make any difference for me. [Maybe

it may be that ghc just not recompiled program when you supplied this
switch. as i wrote, this switch by itself made your original program
1.5x faster on my box. try to delete .o/.exe before rebuilding

and, without this switch representation for !Int32 is the same as for
Int32 - only difference is that when data is assigned to such field
they are evaluated first (and then boxed)

it is not enabled by default, because for *non-primitive* datatypes
such as B below automatic unboxing of strict fields of this type may
decrease sharing and thus memory/performance. imagine for example:

data A = A !B !B
data B = B !Int !Int !Int !Int !Int

b = B 1 1 1 1 1
a = A b b

jhc automatically unboxes strict fields of primitive datatypes, which
is guaranteed to provide only positive effects. may be somesay the
same will be added to ghc

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list