Int vs Word performance?
Malcolm.Wallace at cs.york.ac.uk
Fri Feb 27 06:57:22 EST 2009
"Claus Reinke" <claus.reinke at talk21.com> wrote:
> A while ago, I needed lots of fairly small positive numbers,
> together with a small number of flags for each, so I thought
> I'd switch from Int to Word, and map the flags to bits.
Since there are few guarantees about the size of a Word (or Int), surely
it would be better to choose a definitely sized basic type, e.g. Word8
or Word16? I vaguely recall that ghc used to generate better code for
definitely sized WordN than the generic unguaranteed-size Word.
More information about the Glasgow-haskell-users