in reply to Re: Need help on performance question
in thread Need help on performance question
Also, your advice of "Just test both solutions, use whichever is faster, then optimize that one" is just plain wrong. There's no point in benchmarking unoptimized code, and then decide which solution to toss away. Suppose you have algorithms A and B, benchmark them, and find A to be twice as fast as B. Now you toss away B, and optimize A. Suppose after optimization, A runs three times as fast; that is, 6 times as fast as the unoptimized B. But maybe it was possible to optimize B such that it runs 10 times as fast, making it faster than the optimized A. You wouldn't know, you've already (and too early) decided to go for algorithm A.
You should benchmark *optimized* code. And you should run it with a large range of data set sizes.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Need help on performance question
by robartes (Priest) on Feb 21, 2003 at 11:19 UTC |