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