Topics _224_richards

 

Benchmarking Java with Richards

Richards is an interesting medium-sized language benchmark. The original version was developed by Martin Richards at Cambridge University, England.

There is another version, derived from a Smalltalk implementation by L Peter Deutsch, with significantly different characteristics. This has been used as the basis for comparison in all the papers published by the Self group.

I have taken these two versions, studied them, and built a suite of intermediate versions which exhibit different styles and characteristics.

Richards, times seven

  1. The first, and typically the fastest, is derived from a version by Jonathan Gibbons. The C version is by Mick Jordan. It is very close to the original version in BCPL, and is not very object-oriented. It uses a switch statement to distinguish between one of 8 states, encoded in an integer. The Java version uses final where possible to make things fast.
  2. The second version is a simple modification of the first, using "cleaner" structured programming techniques.
  3. The next version moves some of the task state into separate objects, as in the Deutsch version. No C version, here.
  4. The next three versions use progressively more "pure" object design. E.g., accessor functions instead of variable references, dynamic instead of static methods, interfaces, etc.


Mario Wolczko

There are seven versions listed in order of (roughly) increasing object-oriented-ness. All seven original Richards programs have been combined into a single program in the same manner as 093.nasa7. Equal iteration counts are given to each of the sub-units.

_215_richards_gf Based on a version in BCPL. Methods declared 'final' for efficiency.
_216_richards_f Based on a version in BCPL.
_217_richards_gns Based on a version in BCPL. Uses boolean state variables instead of packed bit arrays and switch statements
_218_richards_dna Based on versions in Smalltalk and C++. Uses public instance variables instead of accessor methods.
_219_richards_dac Based on versions in Smalltalk and C++. Uses 'final' accessor methods.
_220_richards_dav Based on versions in Smalltalk and C++. Uses non-final accessor methods.
_221_richards_dai Based on versions in Smalltalk and C++. Uses non-final accessor methods specified in interfaces.

Richards byte code frequencies