When is optimisation premature?

前端 未结 20 1208
悲哀的现实
悲哀的现实 2020-11-21 23:26

As Knuth said,

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.

20条回答
  •  孤街浪徒
    2020-11-22 00:32

    Unless you find that you need more performance out of your application, due to either a user or business need, there's little reason to worry about optimizing. Even then, don't do anything until you've profiled your code. Then attack the parts which take the most time.

提交回复
热议问题