[Haskell-cafe] newbie optimization question

Stefan O'Rear stefanor at cox.net
Sun Oct 28 16:27:43 EDT 2007

On Sun, Oct 28, 2007 at 08:40:28PM +0100, Daniel Fischer wrote:
> Am Sonntag, 28. Oktober 2007 20:09 schrieb Derek Elkins:
> <snip>
> > >
> > > That fits with my experience writing low level numeric code -- Integer
> > > can be a killer.
> >
> > Inline machine operations v. out-of-line calls to an arbitrary precision
> > integer C library: there shouldn't be any surprise here.  
> Obviously. However, what if 32 bit integers aren't sufficient?
> What perpetually puzzles me is that in C long long int has very good 
> performance, *much* faster than gmp, in Haskell, on my computer, Int64 is 
> hardly faster than Integer. 
> So I stick to Integer mostly, it may be slow but it's correct.

Int64 in Glasgow Haskell is not implemented for speed - it uses the FFI
to call a number of addition/subtraction/whatever primitives in the
runtime.  If this is a problem for you, file a feature request on the
GHC bugtracker.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071028/b2759f8f/attachment.bin

More information about the Haskell-Cafe mailing list