
Hi, Is there any reason not to use these options in combination? Out of habit, I don't usually combine them, but it'd probably be more interesting to do time profiling with optimized code, since the compiler tend to optimize away some of the more pedestrian stuff on its own. When I recently tried this, I got a surprising stack overflow -- surprising, as I don't get that with either option by itself. -kzm -- If I haven't seen further, it is by standing in the footprints of giants

ketil@ii.uib.no (Ketil Z. Malde) writes:
Is there any reason not to use these options in combination?
PS: I probably should mention that I also use -funbox-strict-fields. (And -auto-all, but I guess that's more obvious) -kzm -- If I haven't seen further, it is by standing in the footprints of giants

I always use them in combination. simply because optimization can drastically change the memory useage/profile. profiling the unoptimized version seems rather moot. BTW. does O2 still do not much more than -O? it seems to reduce the memory footprint of some of my apps pretty noticbly. John On Fri, May 16, 2003 at 12:06:48PM +0200, Ketil Z. Malde wrote:
Hi,
Is there any reason not to use these options in combination?
Out of habit, I don't usually combine them, but it'd probably be more interesting to do time profiling with optimized code, since the compiler tend to optimize away some of the more pedestrian stuff on its own.
When I recently tried this, I got a surprising stack overflow -- surprising, as I don't get that with either option by itself.
-kzm -- If I haven't seen further, it is by standing in the footprints of giants _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@foo.net ---------------------------------------------------------------------------

John Meacham
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

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?)
Sure. Write an instance of IOUArray which knows how to pack them :).
participants (3)
-
Hal Daume III
-
John Meacham
-
ketil@ii.uib.no