|
|
|
|
|
by benc666
2498 days ago
|
|
"Premature optimization is the root of all evil" means: make it work correctly first, and then - if anybody cares - make it fast.
Readability/maintainability, then only as needed trade it off for speed, because not all code needs to be highly performant. |
|
If you don't think about performance ahead of time (preferably at the algorithm level) then you will build something correct but slow and it'll be very hard to make it fast without redesigning major parts of it. It's possible to make design choices that paint you into a performance corner very easily, especially with something designed to work on a lot of data. O(n^2) might look like O(log n) for small data and in testing.