kaffe hungs (code attached)

Godmar Back gback at cs.utah.edu
Mon Mar 1 09:15:52 PST 1999


 Dimitri,

Kaffe 1.0b3 doesn't really hang on this test, it just takes a very long time.
The reason was that the long array for the BitSet was grown bit by bit, so 
the test ended up being a gc stress test as lots and lots of long arrays had 
to be created and discarded.  I changed BitSet to at least double the size 
of the array each time it needs to grow it.

For your test, I'm getting:

Kaffe in CVS			(-ms8m -mx64m)
    seconds: 19
    iterations/second: 95445

JDK 1.1.7			(-ms8m -mx64m)
    seconds: 23
    iterations/second: 80222.0

JDK 1.1.7 with TYA 1.2v4	(-ms8m -mx64m)
    seconds: 10
    iterations/second: 185229.0

This is on a Dual PII/350.
Note that I compiled the .java file with pizza as opposed to jikes.

I think we can easily cut down on Kaffe's time by performing manual 
inlining for the bit shift operations in BitSet.java, or even simply by 
compiling Kaffe's class libs with javac as opposed to pizza.

At this point, I believe that kaffe/jit is performance-wise on par with
jdk1.1.7/intr on Linux for *real* applications; in some cases it's even
better than jdk1.1.7/tya.

For instance, for the "sieve" toy benchmark that comes with tya, Kaffe 
gives me a 555 score while TYA1.2v4 shows 436.  Since sieve tests only
the quality of the generated code, Kaffe's poor showing for Dimitri's
benchmark leads me to believe that other reasons may be dominating here,
such as differences in the speed of the run-time libraries (i.e., BitSet)
or differences in how stack overflow checks are implemented etc.

The lesson here is that you
a) want to optimize your run-time libraries
b) want to compile your run-time libs with the fastest compiler available.
   (Hopefully, this will soon be gcj)

	- Godmar

> 
> I have tried running this simple benchamrk program, that runs under
> blackdown's jdk1.1.7v1a.
> However, kaffe-1.0b3 simply stops responding (hungs).
> 
> Is there a bug in there? I have compiled using jikes0.41
> 
> Thanx,
> Dimitris
> 
> --------------98309070694371801946F99F
> Content-Type: text/plain; charset=iso-8859-7;
>  name="testmain.java"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="testmain.java"
> 
> import java.util.*;
> 
>     class testmain
>     {
>         public static void main(String argv[]) {
>             long start = System.currentTimeMillis();
>             int iterations = 10 * 1024 * 1024;
>             BitSet b = new BitSet();
>             for (int i=0; i<iterations; ++i) {
>                 b.set(i);
>             }
>             long stop = System.currentTimeMillis();
>             float rate = iterations * 1000 / (stop - start);
>             System.out.println("seconds: " + ((stop - start) / 1000));
>             System.out.println("iterations/second: " + rate);
>         }
>     }
> 
> --------------98309070694371801946F99F--
> 
> 



More information about the kaffe mailing list