From 8050963a060d79eb860d901a1e3d0a80a6429a17 Mon Sep 17 00:00:00 2001 From: Eliyahu Ravuna Date: Fri, 2 Oct 2015 16:13:59 +0300 Subject: [PATCH] Access memory predictably - Revised according to the feedback in #256 Capitalization revised according to the feedback in #256. (Access memory predictably) --- CppCoreGuidelines.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 2b5edd0..209060b 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -8660,7 +8660,19 @@ make the job of the optimizer much harder. Simple code often optimizes better th Performance is very sensitive to cache performance and cache algorithms favor simple (usually linear) access to adjacent data. -??? +##### Example + + int matrix[rows][cols]; + + //bad + for(int c=0; c PER.30: Avoid context switches on the critical path