Sunday, May 25, 2008

Benchmarking Retro

Retro now has a small, but working, set of benchmarks. This is in the svn repo and can be found in bin/bench. To use the benchmarks, you'll need a console build of Ngaro, a Retro image, a Unix-like host system, and Perl.

  cd bin/bench
./make-image
./run-bench

The timings for each test will be displayed when the test completes. There are currently three tests:
  • Recursive FIB
  • Countdown Loop
  • Call/Return (nesting) Pairs
I expect to see this grow into a more complete set of benchmarks in the future. For now, this should suffice for basic performance testing.

Initial results:

Host: ZenWalk 5 (Linux)
GCC: 4.1.2
CPU: Pentium 4 2.8GHz (1 core)
RAM: 1.5gb

Switched VM:
Recursive FIB (39)... 225.540318 seconds
Countdown Loop (1,000,000)... 13.616979 seconds
Nest/Unnest (256 million pairs)... 36.356847 seconds

Threaded VM:
Recursive FIB (39)... 212.555673 seconds
Countdown Loop (1,000,000)... 13.995988 seconds
Nest/Unnest (256 million pairs)... 33.026269 seconds

1 comment:

Charles Childers said...

Results with a few flags:

-O2 -fomit-frame-pointer

Switched VM:
Recursive FIB (39)... 267.437486 seconds
Countdown Loop (1,000,000)... 13.960576 seconds
Nest/Unnest (256 million pairs)... 37.163615 seconds


Threaded VM:
Recursive FIB (39)... 172.543032 seconds
Countdown Loop (1,000,000)... 10.801669 seconds
Nest/Unnest (256 million pairs)... 22.345299 seconds


-O3 -fomit-frame-pointer

Switched VM:
Recursive FIB (39)... 256.58723 seconds
Countdown Loop (1,000,000)... 17.376516 seconds
Nest/Unnest (256 million pairs)... 40.143567 seconds


Threaded VM:
Recursive FIB (39)... 163.225992 seconds
Countdown Loop (1,000,000)... 9.371017 seconds
Nest/Unnest (256 million pairs)... 22.905958 seconds


I'm getting better performance with -O3 than -O2, but I can set the default to either. What do you recommend?