[Haskell-cafe] ANNOUNCE: ghc-gc-tune: a tool for analyzing the impact of GC flags

Henning Thielemann lemming at henning-thielemann.de
Tue Jul 6 18:02:07 EDT 2010


Andrew Coppin schrieb:

> I've always thought of compiler flags as being a fairly imprecise tool.
> For example, -funbox-strict-fields applies a particular transformation
> to EVERY STRICT FIELD IN THE ENTIRE PROGRAM. Which is fine if it's
> always a win - but then, if it were always a win, there wouldn't be a
> flag to turn it on. It would just be on permanently. ;-) I've always
> thought it's much better to write source annotations on the specific
> fields you want unboxed. You have more control this way. (And you don't
> have to remember any special compiler flags.) I'm talking about unboxing
> of course, but the same deal applies to inlining or any number of other
> source-level transformations that GHC can perform.

http://hackage.haskell.org/packages/archive/bytestring/0.9.1.7/doc/html/src/Data-ByteString-Internal.html

data ByteString = PS {-# UNPACK #-} !(ForeignPtr Word8) -- payload
                     {-# UNPACK #-} !Int                -- offset
                     {-# UNPACK #-} !Int                -- length



More information about the Haskell-Cafe mailing list