unboxed types

Isaac Dupree isaacdupree at charter.net
Fri Jan 4 13:04:41 EST 2008


Simon Marlow wrote:
> Ian Lynagh wrote:
>> On Mon, Dec 31, 2007 at 09:14:04AM -0500, Isaac Dupree wrote:
>>> I guess boxed types are too risky for efficiency reasons in some 
>>> parts of the code
>>
>> Again, I'd hope that that isn't true for modern GHC, and I personally
>> would love to see less unboxed hackery in GHC's sources; I think it
>> sends a bad message: that this sort of thing is necessary to get good
>> performance.
> 
> It's true that unboxed types aren't necessary to get good performance. 
> However, much as I hate to say it, they're necessary to *reliably* get 
> good performance.  When I write code that uses unboxed types, I know I 
> never have to worry about some fragile property being broken when 
> someone tweaks the code in the future, leading to a performance 
> regression that we probably won't notice for ever.

Unboxed values are particularly helpful for that
in part because they make code compile less often.
Therefore they enforce a certain transparency of time-cost in the 
Haskell code, of certain constructs.

Also it directly modifies strictness all over the code... whereas 
bang-patterns are perhaps our best alternative, and we can't use them yet.

~Isaac



More information about the Cvs-ghc mailing list