From 92091c4b81248bcc9bea2b868bdd7d5703ad0038 Mon Sep 17 00:00:00 2001 From: Titus Winters Date: Wed, 17 Feb 2016 10:57:02 -0500 Subject: [PATCH] A more numeric reason for targeted optimization. --- CppCoreGuidelines.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 4731486..f56c19f 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -9945,7 +9945,13 @@ Optimizing a non-performance-critical part of a program has no effect on system ##### 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. -??? + +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 PER.1 and PER.2.) + ### PER.4: Don't assume that complicated code is necessarily faster than simple code