Do I always have to think about performance?

后端 未结 21 773
小蘑菇
小蘑菇 2021-02-04 04:16

I come from a DBA world and performance has always been an obsession. I am turning to development and I always think about performance, constantly, all the time.

Reading

21条回答
  •  一个人的身影
    2021-02-04 04:44

    Generally speaking, obsessing about performance or optimization is the route to much evil in software development. Usually, only about 5% (or less!) of your code has any impact on the performance of the overall system. Your primary goals, first, as a software developer on most projects is getting to correct and reliable functionality and also of course maintainability of the system. Then, once implemented and working correctly, you evaluate performance, find out where the bottlenecks are, and optimize them accordingly to meet your overall goals.

    One Caveat: Doing O(n) type evaluations of approaches you take to things are reasonable things to consider in advance as part of the original system design and algorithm selection, etc. just to feel confident the performance will be "in the ball park". But beyond that, most attempts to optimize things in advance of actually measuring where the bottlenecks are will result in optimizing things that don't matter and usually make things less maintainable, harder to understand, etc.

提交回复
热议问题