Originally posted by Ilja Preuss:
What do you need this for? I do ask because this is a quite general (and possibly hard to answer) question, so knowing more about your needs might help us helping you...
Thanks for your reply. Here are my questions about the optimization techniques:
[list]First Problem:
It seems to me that at least in the client version of the VM the following two source codes have a different performance (Source 2 seems to be better).
Source 1:
Source 2:
Am I right or completely wrong? If I am right does this depend on the
method inlining technique used in the VM?
Anyway: Which methods are inlined and when are they inlined?
Second Problem:
I have read that it is not advicable to use object pools with the Java Hotspot VM. But I have used an iterator pool in my application
and the performance has increased by 10 percent. To be more precise the
code looks like this:
and the classes which uses this iterator looks like this:
Question: Is the increased performance dued to the not local life-time of the iterator objects or is this iterator pool also applicable to normal
for-loops?
Third problem: Because the cast-operators and the instanceof-operator may also
decrease the performance I was wondering if there exists an optimization
technique to optimistically eliminate these operators?
Thanks Stephan
[ October 27, 2003: Message edited by: stephan schweitzer ]