~/talk

Sorting Algorithms: Speed Is Found In The Minds of People

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp]
slides:none on file

Examines crisp, measured tweaks to sorting for hundreds‑element arrays: binary insertion cuts comparisons but loses time due to branch mispredicts; branchless binary is slower; a middle‑out insertion and a contrarian stupid small sort (make a heap then run unguarded insertion) reduces comparisons ~9%, moves ~20% and yields up to ~4% wall‑time win at threshold 63 on Intel tests, with huge wins on some inputs (random 0/1 ~25%). Proposes a composite metric (compares + moves + avg access distance) and argues for type introspection/user attributes to pick thresholds.

AI-written summary · about

  1. 0:00Intro
  2. 3:30Quicksort
  3. 4:43Heapsort
  4. 7:12Early stopping
  5. 10:00Sorting small arrays
  6. 12:53Optimistic insertion sort
  7. 14:29Binary insertion sort
  8. 16:39Predictability and entropy
  9. 18:20Branch prediction is powerless
  10. 18:57Branchless binary search
  11. 24:12Try silly things
  12. 25:05Stupid insertion sort
  13. 27:50Unguarded insertion sort
  14. 30:48The gambit
  15. 32:25Floyds algorithm
  16. 35:51Push heap
  17. 46:11Weird territory
  18. 52:21Random data
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.