Don't Predict, Just Measure

At the same time, I read two articles that coincidently relates to
tuning and performance in Java. One is from Sun's

Improving Java Application Performance and Scalability by Reducing Garbage Collection Times and Sizing Memory Using JDK 1.4.1

(long...) and another is from Martin Fowler's interview:
Tuning Performance and Process

Here are some to note:

  • When you've got a very efficient and effective garbage collection,
    object pool becomes a lot less effective.
  • The cost of object creation may be even cheaper than requesting object from the pool,
    because the garbage collection of the new generation could be done very cheapy now.
  • the time required to clean the pooled objects readying it for re-use could be longer than
    object creation.
  • Profile the code every time you upgrade the VM or compiler, and fine tune your
    software based on your measurement.

So, don't predict, just measure.