A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Vikram Chandna:
I have been assigned the task of reviewing the code for performance issues.
I have been handed a checklist (with suggestions like stringbuffer,arraylist usage,set object handles to null, no prints etc).
fetching entire table rows to do the rowcount when a simple count(PK) would have sufficed etc.
Just to emphasise that such findings are few as : a. My app design knowledge is limited and b.
I have to run through large number of lines. If I start trying to understand every line of code to check for scope for efficiency I will be spending more time learning application and coding techniques.
Thanks for your thought processes.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
[IP]: Just as an aside, a "count(*)" is ways faster than a count on specific columns, as far as I know.[/b]
This may depend on the DB. I remember once getting a performance boost by replacing count(*) with count('x'), since using a literal made it clearer that there was no need to retrieve any data at all.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
"I'm not back." - Bill Harding, Twister
Originally posted by Vikram Chandna:
Stan, Ilja & Jim, thanks for spending your precious time in helping me out.
Thanks anyway. If I make any discovery on how to better manage code review I will share with this group.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Vikram Chandna:
Ilja the circumstance is that our system has gone live and there are reports flying in from everywhere of slow response times. Now we do have developers being asked to look at their respective codes to make them more efficient performance-wise.
Only one person though for JProbe usage as we have only one license.
Kind of things that performance analyst found out were- declaring variable inside a loop, checking a value inside the loop when it could have been done outside and evaluation the value of upper limit in for loop for every iteration.
At my level it's all about speed and efficiency and not necessarily finding the low-hanging fruits that take care of 80% of our problems. The faster I can compile the findings at class-method level and disseminate it to the developers who are in rectfication mode the more we will achieve.
Lot of stuff that I doing is something that could be automated. That's where JTest could have come into play. I was just imagining what an ideal tool could have done for us.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Vikram Chandna:
Ilja the circumstance is that our system has gone live and there are reports flying in from everywhere of slow response times....
Mani
Quaerendo Invenietis
Originally posted by Vikram Chandna:
The presumption of 'code reviews do not help' is that code is reasonable.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
"I'm not back." - Bill Harding, Twister
Quite. Congratulations to the keen-eyed performance analyst -- (s)he has just succeeded in making the code less readable and maintainable for exactly zero gain. Started life as a C programmer, perchance, predating properly optimizing compilers?Originally posted by Ilja Preuss:
"Kind of things that performance analyst found out were- declaring variable inside a loop, checking a value inside the loop when it could have been done outside and evaluation the value of upper limit in for loop for every iteration."
Did you run before- and after-performance tests? It's likely that those "optimizations" didn't do much to overall performance. Especially the "declaring variable inside loop" thing - as far as I know, it even generates identical byte code! With other words, declaration of a local variable is a no-op.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Peter den Haan:
The entire enterprise strikes me as total madness. If your company were a hospital, it would probably be trying to cure its patients by sending them straight into the operating theatre with a dozen blindfolded surgeons making arbitrary incisions in the hope that one of them will hit whatever organ it is that's causing the problems.
Not that it isn't worth reviewing the codebase; if it is as poor as you indicate, it will be a major source of bugs and maintenance problems.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Christopher Farnham<br />Boston, MA<p>"Perfect is the Enemy of Good"
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Vikram Chandna:
What if there are no obvious mistakes and instead it is a case of hundreds of places with scope for minor improvement coupled with inadequate hardware.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi