-O and -prof

Ketil Z. Malde ketil@ii.uib.no
16 May 2003 12:41:42 +0200


John Meacham <john@repetae.net> writes:

> I always use them in combination. simply because optimization can
> drastically change the memory useage/profile. profiling the unoptimized
> version seems rather moot. 

Exactly.  If this is indeed the intention, I guess the stack overflow
is a bug?

> BTW. does O2 still do not much more than -O? it seems to reduce the
> memory footprint of some of my apps pretty noticbly.

Not sure.  The docs seem to indicate the speed improvement is
negligible.  

I thought I saw some hints in the GHC docs, including using
-fvia-C, but I couldn't find them, and  I'm not sure if they would be
still current.

Memory footprint is a problem, I wonder if GHC makes any
effort to pack strict data types?  I.e.

  data D1 = A | B  
  data D2 = A2 | B2 | C2

  data D3 = D !D1 !D2  -- could fit inside e.g. a Word8?

Is there an elegant way to achieve this manually (if I know I'll need
large arrays of D3s, for instance -- can I map them to arrays of Word8
or a similar type?)

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants