Curious Kaffe vs. jdk speed test results under Linux

Constantin Teodorescu teo at flex.ro
Thu Dec 31 01:28:14 PST 1998


Hello to all and A Happy New Year!

I was testing kaffe 1.0b3 and jdk 1.1.7 speed on a Linux RedHat 5.1 i386
Pentium 233 MMX machine 64 Mb RAM.
I am attaching the tiny program used for speed test. Some integer,
string, hashtable operation.

I was expected that kaffe VM with jit should run quicker than the
original jdk 1.1.7 but , strange, it was slower.
jdk 1.1.7 finished the program in 14 seconds,
kaffe 1.0b3 finished it it 30 seconds.

I was curious to see also how the original SUN jre1.1.7B for Windows 95
works. They say that it is using a JIT from Symantec.
Testing the same program, even on a Pentium 150 MHz machine, the test
was finished in 5 seconds. Wow !!!

I am asking you if I'm doing something wrong.
My CLASSPATH is /usr/share/kaffe/Klasses.jar:.

Best regards,
please cc: me on teo at flex.ro , I'm not sure if my mail subscribing works
(yet)
-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA
-------------- next part --------------
import java.util.*;

public class iute {

	public iute() {
		System.out.println("Press <enter> to begin !");
		try {
			int x = System.in.read();
		} catch (java.io.IOException ioe) {};
		System.out.println("Working ...");
		for(int i=1;i<10000;i++) {
			bucla();
		}
		System.out.println("Finished!");
	}
	
	public void bucla() {
		String Rezultat = "";
		Hashtable mht = new Hashtable();
		mht.put("Vasile","615012");
		mht.put("Ion","612023");
		mht.put("Fane","612023");
		mht.put("Lica","612023");
		mht.put("Trefla","612023");
		mht.put("bizona","612023");
		mht.put("mache","612023");
		mht.put("rica","612023");
		mht.put("gugu","612023");
		mht.put("linba","612023");
		mht.put("papuc","612023");
		mht.put("one",new Integer(15));
		mht.put("two",new Integer(152));
		mht.put("three",new Integer(135));
		mht.put("four",new Integer(145));
		mht.put("five",new Integer(155));
		mht.put("pi",new Double(3.14));
		String tel = (String) mht.get("Ion");
		if (tel!=null) {
			Rezultat = "Ion are numarul "+tel;
		}
		tel = (String) mht.get("Fane");
		if (tel!=null) {
			Rezultat = "Fane are numarul "+tel;
		}
		Integer ka = (Integer)mht.get("one");
		if (ka != null) {
			Rezultat = "Numarul este "+ka;
		}
		Object ob = mht.get("pi");
		double x = 3.14;
		for (int j=1;j<100;j++) {
			x = 2.71 + 8512.3/x;
		}
		StringTokenizer tok = new StringTokenizer("gelu ca ma fa de nu pi lo ca nu se te fa");
		while(tok.hasMoreTokens()) {
			Rezultat = tok.nextToken();
			if (Rezultat.equalsIgnoreCase("la mare la munte si la tara")) {
				x = 2*x +3.14;
			} else {
				x = 3*x - 3.14;
			}
		}
	}

	public static void main (String args[]) {
		iute ct = new iute();
	}
}


More information about the kaffe mailing list