[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Seven ways to store 16 bytes

Subject: Re: [Haskell-cafe] Seven ways to store 16 bytes
From: Felipe Lessa
Date: Tue, 5 Jan 2010 23:25:38 -0200
On Tue, Jan 05, 2010 at 04:40:55PM -0800, Bryan O'Sullivan wrote:
> You've got an extra level of indirection there due to the use of data
> instead of newtype, so you're paying an additional boxing penalty for
> everything except your first case. Are you compiling with
> -funbox-strict-fields?

I've changed those data's to newtype's but using words still
seems better, unless mapping and folding over bytes is more
important.  In that case maybe storing the bytes separately might
be better.  Maybe a more complex/realistic benchmark?

I've also rerun the benchmark in a x86-32 chroot.  In this
environment Word32 seems to win over Word64.  But, who cares
about 32 bits anyway? ;)

I'm attaching the source code and the summary results.
Everything was compiled with 'ghc -fforce-recomp -O3'.

--
Felipe.

Attachment: SixteenBytes.hs
Description: Text Data

Attachment: summary32.txt
Description: Text document

Attachment: summary64.txt
Description: Text document

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe
<Prev in Thread] Current Thread [Next in Thread>