Java Development on Ulitzer
Writing meaningful Java benchmarks is a tricky business. It's well known that
the Java Virtual Machine's just in time (JIT) compilation process means that
running an application for a few seconds won't let you predict the
performance of the application over hours or days of uptime. In spite of
this, developers often rely on micro-benchmarks to set performance SLAs for
their applications.
Micro-benchmarks test some small, discrete component of an application.
They're usually written in an effort to benchmark a component considered
critical to the app's overall performance. Here's a typical example, summing
all the numbers from one to a specified limit:
long accumulatedTotal(int limit) {
long result=0L;
for (int i=1; i<=limit; i++) {
result += i;
}
return result;
}
How long does this method take to execute for different values of limit? On
m... (more)