[Mono-list] Worthless benchmarks.

Miguel de Icaza miguel@ximian.com
Tue, 18 Sep 2001 21:01:22 -0400


Hey guys,

   Here are some completely useless benchmaks that I just ran to
compare the fully incomplete testjit from Mono vs other JITers.
Different hardware and barely similar environments:

ThinkPad T20 700 Mhz, native Linux:
Linux time ./testjit fib.exe
19.78user 0.00system 0:19.95elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k

Same ThinkPad T20, with VMware running Windows 2000 Advanced Server,
.NET SDK Beta 2:
winera$ time fib.exe 

real	0m16.114s
user	0m0.040s
sys	0m0.070s

Same ThinkPad running GCC generated code with -O2:
erandi$ time ./a.out 
19.66user 0.00system 0:22.09elapsed 88%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (73major+10minor)pagefaults 0swaps

Same ThinkPad running same Fibonacci test in Kaffe 1.0.6:
erandi$ time kaffe fib
27.03user 0.02system 0:28.26elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (1597major+449minor)pagefaults 0swaps

It is unfair to compare things at this point for other JITers, but I
found the data interesting.  Another data point (this is my workstation):

800 Mhz Pentium III running Windows 2000, .NET SDK:
quack$ time ./fib.exe 

real	0m13.299s
user	0m0.020s
sys	0m0.010s

   Which is interesting, because our JIT engine has not even been
tuned for performance.  Currently we are just working towards
completness and wont be addressing any of the interesting
optimizations until later.

   Currently we use a very simple register allocator;   We barely have
rules that take advantage of the ia32 architecture at this point.

   But we are pretty excited with the results that we have obtained so
far by using the BURS instruction selector.  The results are
encouraging for a first test run.  

   We cant wait to have the JITer complete so we can begin doing some
of the most interesting pre tree-selection optimizations and peephole
optimizations. 

   I am in the middle of cooking a new release (0.7) which contains
all of the toys to play with.  Tonight's snapshot will also have all
the goodies. 

miguel.

// fib.cs
using System;

public class Fib {

	public static int fib (int n) {
		if (n < 2)
			return 1;
		return fib(n-2)+fib(n-1);
	}
	public static int Main () {
		int i, j;

		for (i = 0; i < 100; i++)
			j = fib (32);
		return 0;
	}
}

// fib.java:
public class fib {

	public static void main (String args [])
	{
		int i, j;

		for (i = 0; i < 100; i++)
			j = fib (32);
	}

	public static int fib (int n) {
		if (n < 2)
			return 1;
		return fib(n-2)+fib(n-1);
	}
}

/* fib.c */

static int fib (int n)
{
	if (n < 2)
		return 1;

	return fib(n-2)+fib(n-1);	
}

int main () {
		int i, j;

		for (i = 0; i < 100; i++)
			j = fib (32);
		return 0;
}