mazzo.li

mazzo.li · Personal blog · on HN since 2013

Francesco Mazzoli writes technical posts on Linux performance, io_uring, CPU behavior, SIMD, and type theory.

What HN saysHN commenters praise its performance posts, such as speeding up atan2f and beating the L1 cache, and link its Linux threads and huge pages articles.
35HN people shared it
13linked it in comments
45stories submitted
3.1Kstory points
4 months agolast shared
2013people per year2026

Most-shared posts

  1. 1
    How fast are Linux pipes anyway?
    8 people · 961 points · first shared 2022 · 200 comments on HN
  2. 2
    Beating the L1 cache with value speculation (2021)
    6 people · 470 points · first shared 2021 · 80 comments on HN
  3. 3
    Benefits of Undefined Behavior
    4 people · 9 points · first shared 2025 · discussion on HN
  4. 4
    How to stop Linux threads cleanly
    3 people · 306 points · first shared 2024 · 85 comments on HN
  5. 5
    Waiting for many things at once with io_uring
    3 people · 126 points · first shared 2024 · 30 comments on HN
  6. 6
    Speeding up atan2f
    2 people · 248 points · first shared 2021 · 103 comments on HN
  7. 7
    Lánczos Interpolation Explained (2022)
    2 people · 230 points · first shared 2022 · 17 comments on HN
  8. 8
    Agda by Example: Sorting
    2 people · 38 points · first shared 2013 · 14 comments on HN
  9. 9
    Remote, encrypted ZFS storage server with NixOS
    2 people · 8 points · first shared 2021 · 1 comments on HN
  10. 10
    Reliably Allocating Pages in Linux
    2 people · 8 points · first shared 2021 · discussion on HN
  11. 11
    Haskell, Python, and Readability (2012)
    2 people · 7 points · first shared 2022 · discussion on HN
  12. 12
    Threading Responsibly
    2 people · 3 points · first shared 2017 · discussion on HN
  13. 13
    Archive
    2 people · first shared 2024
  14. 14
    Autoscreen
    2 people · first shared 2021
  15. 15
    When static makes your C code 10 times faster
    1 people · 201 points · first shared 2021 · 108 comments on HN

What HN people wrote when they linked it

rostayob · 2025-10-20
I talk about the cancelability state and how it can help us shortly after that statement: https://mazzo.li/posts/stopping-linux-threads.html#controlled-thread-c… . In hindsight I should have made a forward reference to that section when talking about C++. My broad point was that combining C++ exceptions and thread cancellation is fraught with danger and imo best avoided.
ashvardanian · 2024-11-18
Surprisingly, I only came across Francesco's blog this month. I stumbled upon the 2021 post "Speeding up atan2f by 50x" while searching for others who have to reimplement trigonometry in SIMD every other year. I've also enjoyed "Beating the L1 cache with value speculation" from the same year, as well as the 2013 Agda sorting example. Highly recommend checking it out: https://mazzo.li/archive.html
yagizdegirmenci · 2023-01-22
There is also a great blog post that covers reliably allocating huge pages: https://mazzo.li/posts/check-huge-page.html
bagxrvxpepzn · 2026-06-05
> On modern CPUs, avoiding branch misprediction is a key technique to speed up programs. This is true but it's misleading. The reality is that modern out-of-order superscalar CPUs are so good at branch prediction that it's nearly always better to branch in a tight loop (to allow more ILP) than introduce a data-dependency in a tight loop (which limits ILP). Cf. https://mazzo.li/posts/value-speculation.html, https://yarchive.net/comp/linux/cmov.html Branchless code should generally be avoided because modern CPUs are not designed to optimize that use case. There are exceptions of course, but those are exceptions.
adrianmonk · 2026-05-13
The article mentions this: "A few years back, Linux added a way for software to wait on several events at once, which is something Windows had built in for decades, but Linux didn't." This is not really my area, but from a quick web search, I think they mean io_uring. Here's a blog post about it: https://mazzo.li/posts/uring-multiplex.html
alzamos · 2025-12-23
Francesco Mazzoli’s blog on https://mazzo.li/archive.html. His blog has topped HN a few times with various low-level/linux topics, some deep dives into algorithms etc.
dmoy · 2024-07-12
Well in the articles case, it's the linked list `next` pointers: https://mazzo.li/posts/value-speculation.html#value-speculation-bailin… In a happy case, those will be laid out sequentially in memory so you can guess the value of the pointer easily. (That said your comment still stands, since using linked lists in the first place is much more rare). But I suppose there's probably a lot of other domains where you might have a performance critical loop where some hacky guessing might work.
NukedOne · 2023-12-20
I'll share a couple: - Branch prediction https://danluu.com/branch-prediction/ - How fast are Linux pipes anyway? https://mazzo.li/posts/fast-pipes.html - NAT Slipstreaming v2.0 https://samy.pl/slipstream/
simfoo · 2023-10-06
>vmsplice is more of a mini shared memory mechanism between two processes Doesn't seem to be the case, as it only supports zero-copy from user-memory to the pipe. The other way around results in a copy - see https://mazzo.li/posts/fast-pipes.html#fn10
DerSaidin · 2022-06-02
Hello https://mazzo.li/posts/fast-pipes.html#what-are-pipes-made-of I think the diagram near the start of this section has "head" and "tail" swapped. Edit: Nevermind, I didn't read far enough.
nh2 · 2021-01-12
If you require SSH features (e.g. port forwarding) or want to continue using your terminal's native scroll functionality, here's another alternative that a friend and I devised: https://mazzo.li/posts/autoscreen.html
westurner · 2023-08-28
https://mazzo.li/posts/fast-pipes.html#splicing : > In general when we write to a socket, or a file, or in our case a pipe, we’re first writing to a buffer somewhere in the kernel, and then let the kernel do its work. In the case of pipes, the pipe is a series of buffers in the kernel. All this copying is undesirable if we’re in the business of performance. > Luckily, Linux includes system calls to speed things up when we want to move data to and from pipes, without copying. Specifically: > - splice moves data from a pipe to a file descriptor, and vice-versa. > - vmsplice moves data from user memory into a pipe. > Crucially, both operations work without copying anything. But then to scale to more than one node, everything has to be copied from the pipe buffer to the network socket buffer; unless splice()'ing from a pipe to a socket is Zero-copy like sendfile() (which doesn't work with pipes IIRC). "SOCKMAP - TCP splicing of the future" (2019) https://blog.cloudflare.com/sockmap-tcp-splicing-of-the-future/
packetlost · 2023-08-27

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close