
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. Stefan