HackerTubewatch
Surprise me
Frame from Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019 Plays via YouTube's privacy-enhanced embed

Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019

48 videos recommended on HN
YouTube
7 HN users recommended this talk6 months2019–2024 score 7
Years with an HN recommendation, 2007–2026

HN recommends it as an entertaining talk that starts simple and goes deep on practical performance optimization.

Andrei Alexandrescu's CppCon 2019 talk revisits sorting, showing how branchless tricks, hybrid strategies and a cost metric can speed up std::sort-style algorithms on modern hardware.

“At first he is just showing simple stuff, but stay with it, he goes deep.” (HN, 2023)

2 strong recommendations · 5 recommendations · 4 citations · Talks · advanced

11 Hacker News comments

From the HN archive; up to 20 kept per video, favoring different commenters. Recommendations first.

@jiggawatts Jan 2023 Strongly recommends
on HN thread Ask HN: What's the best lecture series you've ever seen?
Read more
Not exactly a lecture series, but Andrei Alexandrescu has had some fantastic keynote presentations at CppCon. I don't even program in C++ any more, but I've watched these more than once, they're entertaining, approachable, and inspiring: Speed Is Found In The Minds of People [this video] std::allocator Is to Allocation what std::vector Is to Vexation [link] An actual lecture series I've enjoyed watching is "The WE-Heraeus International Winter School on Gravity and Light", which covers General Relativity using modern mathematical approaches: [link] Again, I haven't done physics in 20 years, but I've found it surprisingly easy to follow because it is so clearly presented.
Entertaining, approachable, inspiring keynote on sorting performance
@bboreham Dec 2023 Strongly recommends
on HN thread Ask HN: Programming Courses for Experienced Coders?
I really enjoyed “Speed Is Found In The Minds Of People”, a talk by Andrei Alexandrescu. At first he is just showing simple stuff, but stay with it, he goes deep. [this video]
Starts simple then goes deep on performance
@United857 Oct 2019 Recommends
on HN thread Engineering a Sort Function (1993) [pdf]
If you're interested in these types of implementation/optimization details, Andrei Alexandrescu gave a great talk at this year's CppCon about practical sorting, e.g. when to break out of quicksort to something else: [this video]
Practical sorting and when to leave quicksort
@planteen Oct 2019 Recommends
on HN thread Mispredicted branches can multiply your running times
The article is C++, so not sure why you are bringing up AOT/JIT since it doesn't apply here. And clearly there is a large gain possible by doing a calculation rather than a conditional with a high entropy result, otherwise, the article's mentioned speedup wouldn't have happened. A PGO feedback loop isn't going to do anything on a high entropy conditional. I saw a great talk at CppCon 2019 by Andrei Alexandrescu about speeding up std::sort. He does this same trick among others to speed up the C++ std library sort routine. [this video]
Speeding up std::sort with branchless tricks
@nestorD Nov 2019 Recommends
on HN thread Infectious Executable Stacks
In his talk "Speed Is Found In The Minds of People" [0], Andrei Alexandrescu tries to make a sort really fast for medium sized vector and then closes on thoughts on this precise distinction. If this question intress you, it is worth watching. [0]: [this video]
Optimizing sort for medium vectors, with closing thoughts
@r_sreeram Sep 2023 Recommends
on HN thread Airlines Are Just Banks Now
Read more
Here's an excellent example of what GP said: [this video] (long video, skip to 26:00 if you are in a hurry) The key is that code isn't running in a vacuum. It's operating on data (or controlling systems, etc). A smaller amount of code may be operating on the data in an inefficient manner, whereas a larger amount may be doing it more efficiently. In the above talk, this contrast is very stark, because the "more code" version does some stuff and then does the exact thing the "less code" version does, yet is faster. This kind of thing is common enough (albeit less stark than in the above example), that "less code is faster" is not a great "default" assumption to make.
Shows more code can be faster than less code

Citations, criticism and jokes

@jeffreygoesto Apr 2020 Cites it
on HN thread Folly – Faceboook’s open source C++ library
Well, this argument goes both ways, a generic implementation can never leverage special properties of your data. See i.e. Alexandrecu's talk [0] at about 1:05ff. If as a company you have special use cases or guidelines, you may easily benefit from libraries using these properties. [0] [this video]
Generic implementations cannot exploit data properties
@lumberjackstian May 2020 Cites it
on HN thread Hoare’s Rebuttal and Bubble Sort’s Comeback
I'm not sure about much analysis and theory that explicitly captures branch prediction, but in last year's cppcon keynote Andrei offered a possible metric [0] where he takes into account the average "distance" between two subsequent array accesses. It's basically, (C(n) + M(n) + kD(n)) / n Where M is moves, C is comparisons, k is a some constant, and D is "distance". [0]: [this video]
Proposes a sorting cost metric including access distance
@thomas43 Jun 2020 Cites it
on HN thread Ask HN: What do you recommend for optimization and profiling?
Do you have some more detaile about your app? I use perf, sysprof, trace32, visual studio profiler for profiling, but this highly depends on your environment. These assorted links might be interesting to you: - [link] - [this video] - [link] - [link]
Listed among assorted links on optimization
@jiggawatts Mar 2024 Cites it
on HN thread Algorithms for Modern Hardware
The FAANGS certainly have people doing this kind of work. For example, Andrei Alexandrescu has a bunch of keynote talks at CPPCon where he talks about 1-4% speed optimisations he makes to the std library at Facebook. [this video] I also like the talk by Nicholas Ormrod “The strange details of std::string at Facebook": [link]
Small std library optimizations done at Facebook

Video list and Hacker News comment labels from HackerTube (prompted by @karpathy), released under ODC-By 1.0, built on the open-index/hacker-news archive. Hacker News data is provided by Y Combinator; comments remain the work of their authors. Video titles, channel names and thumbnails belong to their creators and are shown via YouTube. HackerTube Watch is an unofficial edition. Data export of 2026-10-31.

Keyboard shortcuts

/
Search
j k
Next / previous video
r
Surprise me
l
Like (video page)
w
Watch later (video page)
?
This help
Esc
Close