unboxed types
Simon Marlow
simonmarhaskell at gmail.com
Fri Jan 4 11:54:51 EST 2008
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.
When I optimise things, I like them to stay optimised.
Similar problems arise with space leaks. Several times I've profiled GHC
and eliminated a bunch of space leaks, and invariably the leaks come back
again, so now I've given up on fixing all but the really bad ones. One day
I'll add an ASSERT_UNREACHABLE predicate...
Cheers,
Simon
More information about the Cvs-ghc
mailing list