3 ms·
Of course it is not the best use of time to optimize from day one if there is no need to have this piece of software to be fast/efficient, but if performance is
by citrin_ru 4y ago
Of course it is not the best use of time to optimize from day one if there is no need to have this piece of software to be fast/efficient, but if performance is an important requirement it's too late to add it at the end. You cannot optimize Apache 1.x to handle 1M concurrent connections and 1M request per second (without rewriting it more or less fully). Nginx can handle such load on a single modern server because attention to performance (efficiency) was paid from the start of development.
If performance is awful to begin with you can improve it visibly by fixing a few hot-spots (like unnecessary O(N^2) for N which can be large). But when I do profiling for software which is not too bad to begin with there usually no single place which can be changed to give statistically significant improvement - there are many comparably slow places. One can try to improve them piece by piece but sooner or later abstractions will get in the way and if performance is still not enough you'll need to start from scratch keeping performance in mind.
- vlovich123 4y agoDepends on the size of architectural changes needed. I've worked in industry a while though and architectural changes to enable better optimizations happen all the time. You can't know you need a v2 until you've built v1 and understand what the problems with v1 are in production / where things fall down.