This is close to what I was thinking about. I'll be browsing those
papers in general. You seem to have suggested a case where the JVM fits
the benchmark, not the benchmark fits the JVM. I suppose that's
ultimately what is supposed to happen. What I'm seeing now, however,
are microbenchmarks that are written without considering dynamic
optimization. Oftentimes, the test run so quickly that the JVM cannot
catch up. If it runs for awhile, it may be that the method never
finishes, which means the dynamic optimizer never gets a change to issue
a recompile of the code.
> There's an MSc thesis titled "Jikes RVM Adaptive Optimization System
> with Intelligent Algorithms" available at
[quoted text clipped - 22 lines]
>> microbenchmarks that take dynamic optimization into consideration, I'd
>> love to know.
Ian Rogers - 21 Jan 2005 10:15 GMT
If optimizing the micro benchmark will take longer than actually running
the micro benchmark, then no optimization should be performed. The aim
of the adaptive compilation system is minimize the overall runtime of a
program. Sometimes the best thing to do for a method is to optimise it
at the highest level, other times the system can save time by just
interpreting the method. The speed up over interpreting vs the time
spent compiling is approximately an exponential function, and this is
why simple JIT compilers do such a great job.
If you are using the HotSpot JVM you can specify the -server flag to
make it favor optimization slightly more. You can also write harnesses
around the micro benchmarks so that they run for longer.
Ian Rogers
> This is close to what I was thinking about. I'll be browsing those
> papers in general. You seem to have suggested a case where the JVM fits
[quoted text clipped - 32 lines]
>>> microbenchmarks that take dynamic optimization into consideration,
>>> I'd love to know.