3 ms·
> Only if you presume you are always going to start with some horrible piece of code that only uses the worst possible algorithms you may get that kind of speed
by lmm 9y ago
> Only if you presume you are always going to start with some horrible piece of code that only uses the worst possible algorithms you may get that kind of speedup
If we're talking about algorithmic improvements we're usually talking about going from O(n^2) to O(n log n) or similar, which is easily a 100x-1000x or more speedup if your n is big enough to be bothering with performance at all. It's very easy to be accidentally quadratic and this causes a lot of performance bugs. Talking as though algorithmic speedups and optimization speedups are of a similar magnitude is really misleading.
> it could still be 2x too slow to meet some hard realtime performance constraint
Theoretically it could be, but that would take an incredible amount of luck. There's so much variation in runtime that the odds of getting within a factor of 2x are tiny; more likely you're thousands of times too slow, or thousands of times faster than you need to be.
> Two times faster saves a lot of computing time if you have jobs that run for 72+ hours.
Sure, if you've got jobs that run for 72 hours in your code (i.e. aren't spending those 72 hours doing something that's already highly optimized in a standard library e.g. linear algebra) and have already carefully optimized your choice of algorithms, then the rules are different. That's a pretty rare case though.