Algorithms for Modern HardwareSergey Slotin

Algorithms for Modern Hardware

by Sergey Slotin · first published 2022

22mentions
15recommended by
17HN commenters
2022–2026first – last mentioned

88% recommend12% neutral

Algorithmica's book on performance engineering and high-performance computing (free online).

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

50 2007: 0 mentions2008: 0 mentions2009: 0 mentions2010: 0 mentions2011: 0 mentions2012: 0 mentions2013: 0 mentions2014: 0 mentions2015: 0 mentions2016: 0 mentions2017: 0 mentions2018: 0 mentions2019: 0 mentions2020: 0 mentions2021: 0 mentions2022: 4 mentions2023: 4 mentions2024: 5 mentions2025: 3 mentions2026: 2 mentions200720172026

What Hacker News says

  • janwas · Jun 4, 2022 · Recommends

    :) How about Chapter 12 of Agner's awesome manual (https://agner.org/optimize/optimizing_cpp.pdf), http://const.me/articles/simd/simd.pdf, https://en.algorithmica.org/hpc/simd/ ? Does anyone have others to share?

    on “Vectorized and performance-portable Quicksort” ↗
  • momojo · Feb 25, 2022 · Recommends

    There's a great explanation on algorithmica as well: https://en.algorithmica.org/hpc/complexity/languages/

    on “Dive into deep learning compilers” ↗
  • erwincoumans · Mar 7, 2022 · Recommends

    Thank you, that is a nice positive and in-depth review. It is good to discuss technical details of 'Algorithms for Modern Hardware' but it also helps to show how real-world projects struggle or succeed in applying various optimizations: Amdahl's law will move you focus from one serial bottleneck to the other (in large programs).…

    on “Algorithms for Modern Hardware” ↗
  • janwas · Aug 5, 2022 · Recommends

    Sounds good. This might be an interesting read in preparation for those: https://en.algorithmica.org/hpc/algorithms/argmin/

    on “Ask HN: Does someone know a good SIMD programming tutorial?” ↗
  • carapace · Sep 19, 2022 · Recommends

    See also "Algorithms for Modern Hardware" by Sergey Slotin https://en.algorithmica.org/hpc/ > Its intended audience is everyone from performance engineers and practical algorithm researchers to undergraduate computer science students who have just finished an advanced algorithms course and want to learn more practical ways to speed up a program ...

    on “Algorithms for competitive programming” ↗
  • anonymoushn · Mar 9, 2023 · Recommends

    The web site containing the article has a collection of other articles about this sort of thing. You can also read about this in some parts of Algorithms for Modern Hardware[0]. highload.fun includes some other links about this stuff[1]. In general there isn't a great guide and it's best to get your hands dirty. highload.fun happens to be a good place to do that :) [0]: https://en.algorithmica.or

    on “SWAR find any byte from set” ↗
  • snakey · Apr 29, 2023 · Recommends

    Thank you for your incredible work! I have been reading Algorithms for Modern Hardware as part of my after-work study and I have found it invaluable—I reference it daily. I can’t wait for Part II :)

    on “Eytzinger Binary Search – Algorithmica” ↗
  • Pannoniae · Aug 11, 2023 · Recommends

    Read https://en.algorithmica.org/hpc/pipelining/branching/ and the following chapter. TL;DR: you can generate different, and more efficient code if you know how much it is going to be mispredicted.

    on “Fastest Branchless Binary Search” ↗
  • anonymoushn · Oct 2, 2023 · Recommends

    https://en.algorithmica.org/hpc/ and http://0x80.pl/ have some stuff about this, but the latter can be dense. I've had fun getting my hands dirty with some problems at https://highload.fun/ but there's not much direction unless you go to the telegram chat and ask people questions.

    on “SIMD Everywhere Optimization from ARM Neon to RISC-V Vector Extensions” ↗
  • anonymoushn · Nov 11, 2023 · Recommends

    It seems like for the 1d case you should be able to compute the double-prefix sum (the prefix sum of the prefix sum of the input row) and then add 2 elements of that array and subtract 2 other elements to get the output pixel. Here are notes about how to compute the prefix sum, which can be adapted to compute the double-prefix sum: https://en.algorithmica.org/hpc/algorithms/prefix/ Since you acc

    on “Implementing Mario's Stack Blur 15 times in C++ (with tests and benchmarks)” ↗
  • anonymoushn · Dec 29, 2023 · Recommends

    Hello, recently I've enjoyed Casey Muratori's Performance-Aware Programming course[0]. You could read Algorithms for Modern Hardware[1] to learn similar set of stuff though. Casey's course is aimed at bringing beginners all the way to a nearly-industry-leading understanding of performance issues while the book assumes a bit more knowledge, but I think a lot of people have trouble getting into this

    on “Ask HN: Programming Courses for Experienced Coders?” ↗
  • keskadale · Mar 3, 2024 · Recommends

    https://en.algorithmica.org/hpc/ This is a good book. It covers most common concepts and techniques in a fairly accessible way. At they end it also shows builds up a highly optimized version of some algorithms and data structures and does explains every optimization.

    on “Ask HN: How can I learn about performance optimization?” ↗
  • tillulen · Mar 4, 2024 · Recommends

    I admire Daniel Lemire’s work on SIMD implementations. [Lemire] [Lemire] https://lemire.me/en/#publications I learn a lot by reading my compiler’s and profiler’s documentation. For Rust, the Rust Performance Book by Nicholas Nethercote et al. [Nethercote] seems like a nice place to start after reading the Cargo and rustc books. [Nethercote] https://nnethercote.github.io/perf-book/ Algorithms

    on “Ask HN: How can I learn about performance optimization?” ↗
  • josephg · Oct 7, 2024 · Recommends

    I'd be curious to see how performance would change from storing b-tree entries in a semi-sorted array, and applying various other optimizations from here: https://en.algorithmica.org/hpc/data-structures/b-tree/ The aggregate performance improvements Sergey Slotin gets from applying various "tricks" is insane.

    on “Fast B-Trees” ↗
  • ashvardanian · Apr 18, 2025 · Recommends

    I agree that it may not be the most readable format. So far, the best-structured piece on similar topics I’ve seen is Algorithmica: <https://en.algorithmica.org/hpc>. I am sure it overlaps in terms of topics, maybe even some examples, but the homepage suggests that the book is about 500 pages long. I generally don’t have a time budget to read that much, and in most cases, I want to play with the

    on “Less Slow C++” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help