Michael, Jeremy,
At Thursday 09 September 2004 06:56 in comp.lang.java.machine Michael
Amling wrote:
>> does the BigInteger class come as part of the standard JDK? i remember
>> reading about it somewhere but cant remember if it said that this was
[quoted text clipped - 3 lines]
> least since 1.1, which is the oldest Java I run. Maybe someone else can
> recall 1.0.7.
It could have been thought of as an "add-on" in a sense. In early versions
it was implemented via the JNI (or maybe JNI's predecessor--what was that
called?) but now is pure Java.
Once upon I time I found statements about how the Big numerics ended up
faster as pure Java (as the JITs got better) than it was as C code.
There's a forum transcript at <URL:
http://java.sun.com/developer/community/chat/JavaLive/2000/jl0829.html>
where a reference is made to this change, and that conversation took
place in 2000.
The pertinent excerpt from that page:
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
Jacob2: What does the future look like for Java performance? Will there
come a time when Java's performance on things like BigInteger operations
can rival the C/C++ libraries that are out there?
Jeff K.: jacob2 -- In general, Java performance is looking very bright for
the future. The fact is, that except for a few specific gotchas, Java is
performing as well or better than C and C++ today. I'd recommend anyone
who is interested in this to go to our web page's "Additional materials"
section and follow the link to Chris Rijk's article on Aces hardware.
He's an independent (doesn't work for Sun, IBM or any other Java maker)
engineer who did a series of benchmark tests of our JavaTM Virtual
Machine1, IBM's VM, gcc and MSVC. The results will likely both surprise
and please you. The future looks even better. Dynamic compilation is in
its infancy. We are already beating static compilers in many areas and
we've just scratched the surface of what is possible with run-time
analysis driven compilation.
Steve: Jacob2: As for BigInteger, it's worth noting that we rewrote that
in from Scratch in 1.3. It used to be based on an industry-standard C
library for doing this type of thing. Rewriting it in Java sped it up by
a great deal. There are a few "war stories" in the book about this
project. Some of the issues had to do with JNI, others had to do "Object
Mutability" which has it's own chapter in the book.
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
The book they're referring to is "Java Platform Performance: Strategies
and Tactics."
> --Mike Amling
Randall Schulz