Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4228681
Votes 3
Synopsis Some BigInteger operations are slow with very large numbers
Category java:classes_lang
Reported Against 1.2
Release Fixed 1.3(kestrel)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs
Submit Date 12-APR-1999
Description



=20
Some methods like multiplication in BigInteger class are
horribly slow with very large numbers. Much faster
implementations of multiplication and other operations are
possible for very large numbers. I suggest that Java runtime
systems should implement BigInteger methods with faster
algorithms, and with platform optimized code. GNU Multiple
Precision Arithmetic Libary is a  customer  example of large integer
arithmetic implemented with fast algorithms and optimized
code. This improvement would greatly increase Java usage in
many mathematical research fields.
(Review ID: 56837)=20
======================================================================
Work Around
N/A
Evaluation
BigInteger was reworked extensively for the Kestrel release and is faster across the board with a modern JIT. Many algorithms were superceded with better ones but no platform optimized code is used.
  xxxxx@xxxxx   1999-10-28
Comments
  
  Include a link with my name & email   

Submitted On 16-APR-1999
OlliH
Just to let you know... I wrote a quick and dirty
implementation of karatsuba multiplication(in java
language), which is faster than BigInteger multiply
method when doing multiplications with very large
numbers. Multiplication with FFT should be even
faster, and obviously same algorithms in native
code in JAVA runtime environment would be much
faster than interpreted JAVA code.


Submitted On 17-MAY-1999
OlliH
A small correction. GNU multipe precision arithmetic library does not seem to
use faster algorithms for multiplication, just optimized code.


Submitted On 08-MAY-2005
eliasen
A correction to your correction.  GMP does indeed use faster algorithms for multiplication:  Karatsuba, 3-way Toom-Cook, and then FFT in that order.

You don't think they get that amazing speed by using the dumb O(n^2) algorithm, do you?



PLEASE NOTE: JDK6 is formerly known as Project Mustang