mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
A more numeric reason for targeted optimization.
This commit is contained in:
parent
23b7ceab9c
commit
92091c4b81
|
@ -9945,7 +9945,13 @@ Optimizing a non-performance-critical part of a program has no effect on system
|
||||||
##### Note
|
##### Note
|
||||||
|
|
||||||
If your program spends most of its time waiting for the web or for a human, optimization of in-memory computation is probably useless.
|
If your program spends most of its time waiting for the web or for a human, optimization of in-memory computation is probably useless.
|
||||||
???
|
|
||||||
|
Put another way: If your program spends 4% of its processing time doing
|
||||||
|
computation A and 40% of its time doing computation B, a 50% improvement on A is
|
||||||
|
only as impactful as a 5% improvement on B. (If you don't even know how much
|
||||||
|
time is spent on A or B, see <a href="#Rper-reason">PER.1</a> and <a
|
||||||
|
href="#Rper-Knuth">PER.2</a>.)
|
||||||
|
|
||||||
|
|
||||||
### <a name="Rper-simple"></a>PER.4: Don't assume that complicated code is necessarily faster than simple code
|
### <a name="Rper-simple"></a>PER.4: Don't assume that complicated code is necessarily faster than simple code
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user