views:

37

answers:

2

Hello there,

I would like to test the speed of different Java platforms and thought about creating a JojoMips benchmark routine that would work like the Linux BogoMips. It would do a calculation and would provide a number like: 4346 JojoMips. The faster the virtual machine, the higher the JojoMips. I thought counting how many decimals of PI a vm could calculate in 1 seconds.

Any input / code / ideas and remarks would be appreciate.

Thank you. Daniel

+2  A: 

You should probably make sure to exercise most or all of the JVM bytecode operations. http://en.wikipedia.org/wiki/List_of_Java_bytecode_instructions

Otherwise your measurement will be incomplete.

z5h
Measuring all of the bytecode operations in isolation won't be enough, because modern JVMs don't do simple 1:1 translations. They optimize large-ish pieces of code and thus you'd need big chunks of code that operate pretty much like real-life code. SPECjvm does that ...
Joachim Sauer
That's a good point. All I was suggesting, was to be sure *at minimum* all bytecodes were exercised. It would be easy to write lots of code to be bencharked and still miss some bytecodes.
z5h
A: 

BogoMips is not a benchmark. It's simply a constant used to perform spinloops of a specified duration.

What you're talking about (calculating digits of pi) is more analogous to SPEC INT or FP benchmarks; there's certainly nothing wrong rolling your own, but there's already a SPEC JVM benchmark.

Eric Seppanen