From c8ad69784843f18416b1d99fa0a2075473ec69b7 Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Mon, 12 Mar 2018 08:44:25 -0700 Subject: [PATCH] add note about sorting --- performance.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/performance.md b/performance.md index fd627ac..73b2b81 100644 --- a/performance.md +++ b/performance.md @@ -878,6 +878,8 @@ Techniques specific to the architecture running the code counts[i & 1] ++ "branch-free code", benchmark; not always faster, but frequently harder to read +* sorting data can help improve performance via both cache locality and branch prediction, even taking into account the time it takes to sort + * use a specialized sort, such as radix sort, if possible * function call overhead * reduce data copies