Benchmarks

In order to explore whether use of integer or floating-point code makes much difference to performance, I have done some crude Java benchmarks, of integer and floating-point performance on my two machines.

The results are as follows:

TestAMD intAMD floatG4 intG4 float
Addition4025018702006
Scalar multiplication10131018911973
Squaring13036119111911
Square root71193129038369
Scalar division4051122982319
Division67125023042075
Shift right5051119142318

AMD: AMDK6II, 400Mhz, 100Mhz memory, with the Microsoft JVM.

G4 = "whatever's in the Mac", with the built-in JVM.

My benchmarks are terribly unsophisticated - but should give the general idea.

For details you can look at the Java source code.

Summary

Integer performance is better on the x86. For some reason, floats beat integers on the division test, but not on anything else.

On the G4, floating point performance is much more nearly comparable to integers, but use of floats is still uniformly slower - excepting this time division (where floats come out slightly ahead) and squaring (which proved to be a dead heat).

According to these crude tests, Java performance on the G4 sucks - despite its faster and better processor.


Index | Links


tt@cryogen.com | http://alife.co.uk/