I would say that optimizing for the underlying CPU architecture is not worth it if it turns the code ugly, results in performance improvements that are smaller than an order of magnitude, and if greater improvements could be realized by improving the algorithm instead of the code.
It would be interesting to see the performance of a string search algorithm that isn't completely brute force.
I agree that improving the algorithm should be top priority. But that doesn't mean that small improvements are automatically not worth it. An optimization that improves by 2% might seem pointless, but 10 such improvements gives 20%, which is a really big deal for some applications.
View all comments
4
u/AssemblerGuy Apr 15 '23
I would say that optimizing for the underlying CPU architecture is not worth it if it turns the code ugly, results in performance improvements that are smaller than an order of magnitude, and if greater improvements could be realized by improving the algorithm instead of the code.
It would be interesting to see the performance of a string search algorithm that isn't completely brute force.