img
. .
Related to this is correctness. Correctness is more important than either performance or time to
market. Minor bugs and occasional crashes can be traded off against time to market, but
fundamental correctness is essential. Unfortunately, this is a major battle between engineering and
marketing all the time.
Available Human Resources and Programming Costs
If you can speed your program up by 50 percent, but it takes 60 programmers two years to do it, is
it worth it? Maybe yes, maybe no. It's up to you and you should be thinking in these terms when
you begin the optimization efforts.
Portability
Some of the techniques we're going to discuss will require customizing to a particular platform or
even to a particular configuration. Is such specialization worthwhile to you? Maybe yes, maybe no.
Sunsoft does a PSR (Platform Specific Release) of Solaris for each different machine (one for the
SS1, another for the SS2, a third for the SS10, etc.). Ninety-nine percent of the code will be shared,
but things like byte copy will be optimized for the exact CPU, memory bus, and cache
configuration.
It is highly unlikely you would ever go as far in your own code. The normal thing is to optimize
for a specific configuration (typically, the highest-performance one) and admit that the others will
be a bit suboptimal. Would you want to write and maintain upward of 20 PSRs just for Sun
machines? And another 20 for SGI, DEC, etc.?
User Perception
Yes, you might be able to optimize an editor to process keystrokes twice as fast. The user wouldn't
care, because the user can't tell the difference between 1-ms and 2-ms response time anyway.
Don't waste your time on useless optimization.
Easier said than done, of course. Especially as the world is rife with inappropriate benchmarks
upon which people do base their buying decisions. Sorry.
Competition
Being 10% faster means nothing to the user. It looks great on the data sheets, but that's about it.[2]
Your program is not a commodity; don't sell it as if it were. Of course, if your program runs 50%
slower than the competition, you may need to speed it up significantly. Make sure that you get the
time and support you need.
[2]
Yes, performance numbers on data sheets are important because people do make decisions
based upon a 1% difference in a published benchmark (dumb, but real). Nonetheless, given a
choice between releasing 5% slower than the competition today and 5% faster next year, we'd opt
for today.
Targeted Machine Configuration
You have to select your primary target machine and you have to declare some configurations
inadequate. If you can't get your desired performance on a x286, don't sell on a x286.[3] Next year's
machines will be twice as fast anyway. Sometimes, "throwing money at the problem" is the right
answer.
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home