[freenet-dev] Re: [kaffe] Kaffe and Freenet, round (N+1)

Mark Wielaard mark@klomp.org
Wed Jun 4 00:16:01 2003


Hi,

On Wed, 2003-06-04 at 05:08, Greg Wooledge wrote:
> Toad (toad@amphibian.dyndns.org) wrote:
> > On Tue, Jun 03, 2003 at 01:58:58AM +0200, Mark Wielaard wrote:
> > > You might want to try to configure kaffe with --enable-pure-java-math
> > > that will give you another (the GNU Classpath) java.math.BigInteger
> > > implementation (which doesn't use the native libgmp).
> > 
> > Eeek. Sloooooooow. But I suppose if it's all that works.
> [...]
> Next, I tried with --enable-pure-java-math.  This seemed to be working
> better; I could run the node and retrieve documents via fproxy (the
> web interface) without "Negative bit address" errors.  But, as Toad
> said, it's incredibly slow compared to gmp.  Running top, I saw
> kaffe-bin take about 30-40% (with spikes up to 90%) of the CPU when
> I hit a few image-heavy pages.  Normally I don't see it get over
> 50% even when it's doing FEC decoding -- under normal conditions,
> like retrieving a few pages of images, it never got over 20% or so.

Good it works (more or less, haven't a clue about the coma thing).
Bad it is slooooooooow.
The same code is used in gcj where is doesn't seeem slow at all but that
might be because gcj is an ahead-of-time compiler that can much better
optimize this code then the kaffe just in time compiler.
The GNU Classpath implementation is based on the pure java gnu.math.MPN
class which says:

/** This contains various low-level routines for unsigned bigints.
 * The interfaces match the mpn interfaces in gmp,
 * so it should be easy to replace them with fast native functions
 * that are trivial wrappers around the mpn_ functions in gmp
 * (at least on platforms that use 32-bit "limbs").
 */

So one approach might be to create a gnu.math.MPNNative that actually
wraps the gpm functions.

> So, the upshot is, I'm still running early-May CVS Kaffe.  It's the
> only thing that still works.

But I didn't know that it already worked with an older kaffe version.
Can you determine on which date it actually broke?
The strange thing is that the last work on the kaffe implementation of
BigInteger is from Januari.

Cheers,

Mark