Abhinav Upadhyay
abhi9u.bsky.social
Abhinav Upadhyay
@abhi9u.bsky.social
NetBSD Dev | Python Internals, AI, compilers, databases, & performance engineering | https://blog.codingconfessions.com/
System calls are the interface between the user space and the kernel. They are needed for fundamental things like reading a file, and making a network call. But they are also very expensive because they need to do things like saving/restoring registers, page table, stack.
September 21, 2025 at 12:47 PM
Skipping computer architecture was my biggest student mistake. Hardware’s execution model dictates memory layout, binaries, compiler output, and runtimes. If you want to build systems, learn how the CPU works. I wrote an article on this:

blog.codingconfessions.com/p/seeing-the...
May 21, 2025 at 4:42 AM
If you want a more detailed explanation of what is happening here, and why the `not` operator doesn't need to do the same thing: see my article.

blog.codingconfessions.com/p/python-per...
April 12, 2025 at 8:43 AM
Here’s a fun visual showing how len() finds the length of a list in Python.

The size is stored right inside the object, but len() takes a five-pointer detour, only to land back where it started.

This is why if not mylist is ~2x faster for emptiness checks!
April 12, 2025 at 8:43 AM
When you see an expert optimize a piece of code, it may look like dark magic. In reality, these experts have a deep understanding of the entire computing stack, and when they look at an application profile, they quickly understand the bottlenecks.
March 28, 2025 at 8:48 AM
Woke up to an email from Douglas Mcilroy himself in response to my article on his work on Unix Spell. I am very grateful that he took the time to read and respond to it!

PS: I fixed the error he found in the article.

Article: blog.codingconfessions.com/p/how-unix-s...
February 5, 2025 at 2:03 PM
How do you fit a 250kB dictionary in 64kB of RAM and still perform fast lookups? For reference, even with gzip -9, you can't compress this file below 85kB.

In the 1970s, Douglas McIlroy faced this exact challenge while implementing the spell checker for Unix at AT&T.
January 19, 2025 at 3:52 AM
Some old papers are a joy to read because of their simplicity. This is the abstract from a 1966 paper describing a compression technique for infinite codes.

For static data, you know the probabilities of the symbols, and can build a Huffman tree, but for an infinite stream, you can't do that
January 5, 2025 at 8:38 AM
An article I wrote a while back was trending on HN today. It explains the impossibility theorem of clustering, according to which a perfect clustering algorithm is impossible to achieve.
December 27, 2024 at 4:09 PM
You thought systems programmers don't need to know math? Linux kernel developers prove you wrong by contradiction—they prove corollaries in their comments.
December 26, 2024 at 9:17 AM
Continuing on the hardware concurrency thread, this paper is a must read. It simplifies reasoning about concurrency on x86 by providing an abstract machine model
December 20, 2024 at 4:24 PM
What every systems programmer should know about concurrency—a very dense but impactful read. Things like lock free and wait free synchronisation techniques will stop seeming like black box if you understand this.

PDF: assets.bitbashing.io/papers/concu...
December 8, 2024 at 5:36 PM
Ulrich Drepper is a rockstar. I keep running into his papers. This one is on the implementation of thread local storage:

PDF: www.akkadia.org/drepper/tls....
December 7, 2024 at 2:01 PM
Hacking on some code while Cooper is occupied watching a movie.
November 21, 2024 at 4:31 PM
Ben Affleck's interview on his views on LLMs is going around. I wonder if Matt Damon is somewhere saying this to someone:
November 19, 2024 at 1:33 PM
November 15, 2024 at 3:24 PM
Found this Easter egg in the CPython code today. As I looked at it I wondered who is Randall? Is he someone like David Beazely for whom special code was added. Mystery unravelled when reached the last line and found the xkcd reference :)
November 13, 2024 at 11:49 AM
My dog is turning into quite an actor
November 12, 2024 at 3:49 PM
The Linux kernel has a JIT compiler for compiling the bytecode of BPF programs into machine code. How does it work?
November 4, 2024 at 3:47 AM
Love this (new?) fish feature. On doing <Tab> with a partially written man page name, the autocomplete also shows a description of the suggested man pages so I can quickly tell which one I want to look up
November 2, 2024 at 8:18 AM
Aligning up or down to a power-of-2 boundary is a very common operation. I've seen many people use the % operator to do it. But there is a more efficient way of doing it in just 2 instructions.
November 2, 2024 at 4:34 AM
One of the rare days I had a chance to refer to this for something I'm working on
November 3, 2023 at 10:01 AM