Jack Numen wrote:I agree that JVM does optimization on the fly and have also answered some queries related to optimisation stuff. In My case with such a piece of code i can insert 10-50 records in less than 15secs but when it comes to 100 more records like this it will(and is) definetly take 2-3mins for such insertions.
100 more? Like William, I think you plainly have no idea just how fast modern processors are.
If there were 100
million more records, AND I could
prove that:
(a) the code is currently running
too slowly.
(b) this particular optimization makes all the difference between running too slow and running acceptably fast.
I might consider optimizing.
But to do that, as he says, you need to
profile.
My favorite quote about optimization (it used to be my signature):
"
More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason — including blind stupidity."
— W.A. Wulf
Winston