// BLOG · PAGE 7 OF 8

All posts

ALL POSTS · PAGE 7 / 8

HARDWARE

From Power Button to Kernel: How a PC Boots

At reset, an x86 CPU wakes up pretending it's 1978 — 16-bit mode, 1 MB address space. Everything after that is bootstrapping: firmware, boot sector or EFI application, protected mode, and finally a kernel. I wrote a bootloader to learn the path; here's the map.

DATABASES

How Query Planners Think: Costs, Cardinality, and Lies

SQL says what, the planner decides how — by estimating row counts through a chain of guesses and picking the cheapest of thousands of plans. When the estimate is wrong by 1000x, so is the plan. Reading EXPLAIN is learning to audit those guesses.

MEMORY

Intrusive Lists: How the Kernel Does Data Structures

The Linux kernel's list_head puts the container inside the object instead of the object inside the container — one implementation, zero allocations, and a container_of macro that looks illegal but isn't. I built a library around the pattern; here's why it wins.

ALGORITHMS

Arrays vs Linked Lists: The Benchmark Textbooks Don't Run

The textbook says linked lists win at insertion, O(1) vs O(n). Run the benchmark and the array wins insertion-heavy workloads too — often by 10x. The memory hierarchy voted, and it didn't vote for pointers.

PERFORMANCE

Ring Buffers: The Data Structure at Every Fast Boundary

NIC queues, io_uring, audio pipelines, logging, SPSC channels — wherever a fast producer meets a consumer on a budget, there's a fixed array with two indices. The design decisions that matter: power-of-two sizing, the full/empty problem, and who waits.

MEMORY

Virtual Memory: The Lie Every Process Believes

Every process thinks it has a private, contiguous address space starting at zero. None of them do. Virtual memory is the translation layer that makes the lie hold — and it's why fork, mmap, and swap can exist at all.

ALGORITHMS

What Your Language's sort() Actually Runs

Nobody ships textbook quicksort. Python runs Timsort, C++ runs introsort, and both are layered hybrids built around one insight: real-world data isn't random, and worst cases must be impossible.

DATABASES

Buffer Pools: Why Databases Don't Trust Your OS

Databases read disk through fixed-size pages cached in a buffer pool they manage themselves — duplicating what the kernel's page cache already does. The reasons why (eviction control, WAL ordering, O_DIRECT) are a masterclass in when to bypass the OS.

PERFORMANCE

CPU Caches: The Memory Hierarchy Your Code Lives In

DRAM is ~100ns away; your CPU can do ~400 arithmetic operations in that time. Caches exist to hide that gap, and whether they succeed is decided by how your code lays out and walks its data.

MEMORY

Page Tables and the TLB: The Cost of Every Address

Every pointer dereference triggers a virtual-to-physical translation through a four-level radix tree. The only reason your machine isn't 5x slower is a tiny cache called the TLB — and when it misses, you feel it.

PERFORMANCE

Why 0.1 + 0.2 ≠ 0.3, and Why It's Worse Than You Think

Everyone knows floating point is 'imprecise.' Fewer know that the same expression can give different results on different machines, that summation order changes your answer, and why associativity — the thing algebra promised you — is a lie in float.

EMBEDDED

MQTT: Why the IoT World Runs on a 1999 Protocol

MQTT moves a temperature reading in about 30 bytes over a connection that survives flaky cellular links and sleepy microcontrollers. The publish/subscribe model, the three QoS levels, and the retained-message and last-will tricks that make it click.