On 07/08/13 08:44, Sebastian wrote:
@Override
public int compare(AttrValue o1, AttrValue o2)
{
Long ts1 = o1.getEffectiveSequenceNumber(); // ??
Long ts2 = o2.getEffectiveSequenceNumber(); // ??
return ts1.compareTo(ts2);
}
Would you expect a measureable impact of creating these
variables ts1, ts2, instead of "inlining" the calls to
getEffectiveSequenceNumber(). (Using JDK 6?)
How can I reason about this things, probably influenced by
JIT, without doing actually measurements, say as part of a
code inspection?
Have you heard of a profiler?
A few years ago I used one to investigate an application running on
Weblogic application server, the results were eye opening.
I seem to remember the company I was working for handed over a large wad
of cash to get a couple of licences for a commercial product ... can't
remember what it was called unfortunately.
Googling 'java profiler' today returns the usual plethora of hits and I
expect the game has moved on since I last used one, there also appear to
be a bunch of free ones out there.
If you want to reason about this stuff then it might pay you to have a
look at your application with a profiler, you will almost certainly
learn something to help you in your endeavors.