[MLton] latest benchmarks

skaller skaller at users.sourceforge.net
Thu Jun 21 11:06:48 PDT 2007


On Thu, 2007-06-21 at 09:01 -0500, Matthew Fluet wrote:

> But, this is SML -- we need to handle overflow checking on conversions, 
> etc.  As you say, though, a 32 to 64 bit extensions doesn't need 
> additional checks, so Array.sub and Array.update are actually pretty 
> fast.  But, the implementation of something like
>    Array.appi : (int * 'a -> unit) -> 'a array -> unit
> is internally using a 64bit integer for the index variable, which it 
> repeatedly casts down to the 32-bit integer to deliver to the user 
> function.  That cast needs to check for overflow (though, I believe that 
>   one can't construct an array with more than 2^31 elements (since 
> Array.array : int * 'a -> 'a array takes a 32-bit length), so the cast 
> can't overflow).

Ok, makes sense.


> But, wouldn't all of this imply that the 32-bit executables run on an 
> amd64 would have even worse performance, since they never use 64-bit data?

Yes .. that's what actually happens: 64 bit code is faster.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net



More information about the MLton mailing list