Charles Oliver Nutter wrote:
> On a side note: any recommendations for optimizing fixnums on current 
> JVMs?

"Optimizing fixnums" is of course a number of different problems.
One is "optimizing generic arithmetic" on unknown types - most
of which will be fixnums.

Kawa does pretty well on optimizing arbitrary-precision integers.
It wins over java.math.BigInteger by using just two fields, one
which is an int and on is an int[].  The latter is only non-null
when the value of the integer doesn't fit in the bounds of int.
I think this would be a worthwhile optimization for BigInteger.
The various operations "fast-path" the common case when the values
fit into an int (and thus the int[] is null).

Kawa also does preallocate the number -100 .. 1024.  I haven't
done any measurements to see if this is a good range to
pre-allocate - that might be useful to get some numbers on.
-- 
        --Per Bothner
[EMAIL PROTECTED]   http://per.bothner.com/
_______________________________________________
mlvm-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to