Newsletter #121
Enjoy Newsletter #121.
How 2004 RuneScape fit a multiplayer RPG into 56k dial-up
This post dissects how 2004 RuneScape ran a massively multiplayer world over 56k dial-up modems, where real-world throughput was just a few kilobytes per second and the Java applet client had only a single TCP connection. Rather than sending self-describing messages, the network protocol was co-designed as a shared state machine between client and server: both sides held the exact same collision map, ran the same pathfinding algorithm, and stepped forward on a 600 ms server tick. Thanks to all that shared implicit context never having to cross the wire, walking across the map cost roughly 7 bytes upstream and 9 bytes downstream per observer—the client only sent path waypoints where direction changed, and the server validated and reconstructed the rest.
The most fascinating takeaway is how saving bytes goes far beyond generic compression. The most common state was made practically free: an idle player in your viewport cost a single bit, meaning standing among twenty stationary players took roughly five bytes per tick to confirm nothing changed. Newly appearing players were encoded using 5-bit relative coordinates offset from the local player rather than 16-bit global world coordinates. Bit-packing was reserved strictly for small, high-frequency movement updates; larger, rarely changing appearance blocks stayed byte-aligned so the server could cache and memcpy pre-built buffers directly. The architectural lesson: the smallest possible wire format comes from tightly coupling client and server assumptions, trading away the self-description, independent deployability, and easy debugging that modern HTTP/JSON APIs prioritize.
How does struct{} take zero bytes in Go
This article explains why Go’s empty struct struct{} occupies zero bytes and how it is idiomatically used to represent presence or signaling rather than data. Inspecting unsafe.Sizeof confirms that an empty struct takes 0 bytes; used as the value type in map[string]struct{}, it expresses a pure set where only key existence matters, and on a channel (chan struct{}) it signals an event without carrying a payload. The author also notes that starting in Go 1.24, Go’s built-in maps use Swiss Tables under the hood, leaving almost no meaningful memory difference between map[string]struct{} and map[string]bool—so choosing struct{} today is mainly about expressing intent clearly.
At the runtime level, whenever a zero-sized value has to be allocated on the heap, mallocgc checks for size == 0 and returns a pointer to a single global runtime variable named zerobase instead of allocating heap memory. Whether the value escapes to the heap in the first place is decided by escape analysis: passing it to fmt.Println (which takes any) often triggers an escape to zerobase, whereas built-in println keeps it on the stack. This design creates two subtle gotchas worth remembering. First, multiple distinct struct{} variables may share the exact same memory address, and the compiler is free to merge or not merge them, so you should never rely on pointer equality to distinguish zero-sized values. Second, placing a struct{} as the final field inside a larger non-empty struct causes the compiler to add 1 byte of trailing padding (plus alignment) so that taking the address of that final field doesn’t point past the end of the allocation into an adjacent object; if you want zero overhead inside a struct, place the empty struct field anywhere except last.
Is Cloudflare silently killing the web hosting industry?
Konrad Keck argues that Cloudflare isn’t killing traditional web hosting by becoming a better shared host—it is doing it by moving the starting point of how websites get built and deployed. Historically, a customer bought a domain, signed up for shared hosting, logged into cPanel, installed WordPress, configured SSL and email, and maybe put Cloudflare in front later for CDN and DDoS protection. Today, when a project starts inside Claude Code, Cursor, Lovable, Bolt, or Replit, the question is no longer “which hosting plan do I buy?” but “where do I deploy this?”, and Cloudflare, Vercel, and Netlify are built to capture that exact moment. Cloudflare is competing on workflow, not just infrastructure.
Keck highlights two main levers: near-zero-cost deployment via Pages, Workers, static assets, and usage-priced R2/D1—which hollows out traditional hosting’s bread-and-butter market of landing pages, docs sites, frontends, and small APIs—and at-cost domain registration as a top-of-funnel wedge into the ecosystem. Cloudflare’s Registrar API closes the loop even further: an AI agent can scaffold a project, suggest available domains, check pricing, register the domain, configure DNS, and deploy to production without the user ever visiting a hosting control panel. Traditional web hosts aren’t disappearing overnight—legacy WordPress/WooCommerce and PHP apps, real business email, hands-on migrations, emergency support, local compliance, and non-technical SMBs still rely on human-backed services. The strategic shift is that traditional hosts must evolve into specialized managed service providers, because selling the default starting point of a website is slipping away.
Don’t Stack Weaknesses
Stay SaaSy writes about an organizational failure mode that often hides in plain sight across leadership chains: stacking the same weakness across multiple layers of management. Almost every leader has at least one real weakness—someone might be a visionary strategist but poor at operational execution, or deeply technical but weak at executive communication—and on its own, that doesn’t sink an org. The danger comes when a leader hires or promotes direct reports who share the exact same blind spot. If both a VP and their directors are weak at operations, the odds of the teams underneath them having strong operational processes drop to nearly zero: leadership doesn’t know how to do it themselves, doesn’t know how to interview for it, and can’t accurately judge whether it’s being done well.
Weakness stacking usually happens unconsciously: leaders naturally recognize and reward strengths that mirror their own, labeling that similarity “values alignment” or “culture fit” while actually cloning their own skillset and blind spots. Avoiding the trap starts with an honest self-assessment across six core axes—technical/domain depth, people management, process and operations, strategy, communication/presentation, and learning agility—and then deliberately hiring people who are significantly stronger than you in your weakest areas. The post also warns against comforting yourself with “I could do operations if I really wanted to,” which is almost always an excuse to avoid confronting a gap. An organization without stacked weaknesses is far more resilient to unexpected challenges.
System Design Cheatsheet
This gist serves as a compact checklist for system design interviews and architecture reviews, anchored on a core principle: good architecture is about picking the right battles and managing trade-offs. It outlines a familiar five-step loop: clarify scope through use cases and constraints; sketch a high-level design covering core services, storage, caching, and load balancing; dive into component details including APIs and data schemas; identify bottlenecks; and scale vertically or horizontally as needed. For newer engineers, its biggest value is forcing quantitative questions early, before jumping to technology choices: how many requests per second, what is the read-to-write ratio, how fast does data grow, does latency or throughput matter more, and where does the system sit on the consistency-versus-availability spectrum?
The scaling section reviews foundational building blocks: multi-tier caching, load balancing, replication and sharding, MapReduce for batch data processing, and platform separation so components can scale independently. It also lists six core fundamentals worth mastering: concurrency, networking, abstraction boundaries, real-world hardware performance numbers, back-of-the-envelope estimation to rule out dead ends early, and fault tolerance in distributed environments. While brief and carrying a few older examples, it remains a solid mental checklist: characterize load, data shape, failure modes, and scaling paths before picking tools.
SQLite improving performance with pre-sort
Anders Murphy follows up on his earlier SQLite UUIDv4 vs. UUIDv7 benchmarks with a tougher scenario: what happens when your primary key must be a 160-bit cryptographically random value generated via SecureRandom—such as a session token—where you cannot switch to time-ordered UUIDv7 because you need maximum entropy and zero timestamp leakage? When batch-inserting one million rows into a WITHOUT ROWID table keyed by a BLOB PRIMARY KEY, insert throughput starts around 100,000 rows per second and steadily degrades as the table grows. The bottleneck isn’t SQLite being slow; it’s the physics of a B+ Tree: because the tree stores keys in sorted order, sequential inserts append cleanly, whereas uniformly random keys scatter writes across leaf pages all over disk, triggering constant page splits and tree rebalancing.
Murphy’s optimization is disarmingly simple: since the application is already inserting in batches, sort each batch in memory by primary key before inserting. Because SQLite compares BLOB keys using memcmp(), the application-side comparator just needs to match byte-wise ordering; Murphy grabs the first 8 bytes of each 20-byte token as an unsigned 64-bit integer to make the in-memory sort fast. Even including the CPU cost of sorting each batch, once the table reaches ten million rows, batch insert time drops from 11.1 seconds to 3.8 seconds—roughly a 2–3x speedup. The practical takeaway: batching doesn’t just amortize transaction overhead; it also gives you a window to reorder writes into a layout that is far friendlier to the underlying storage engine.
Why is Meta destroying its engineering organization?
Gergely Orosz pieces together a tense picture of engineering inside Meta since April 2026, as the company pivots aggressively around AI. Historically, Meta was renowned for its strong bottom-up engineering culture: lightweight process, high individual autonomy, rock-solid internal tooling that let engineers “move fast,” and engineers treated as the core value creators. Under the direction of Mark Zuckerberg and Alexandr Wang, however, 30–50% of core software engineers across many teams—including infrastructure and security—were reassigned into a new ADO organization (roughly 6,500 people) to do data labeling, model output grading, and RLHF. Meta also rolled out mandatory keystroke and mouse tracking on engineering laptops to harvest training data with no opt-out (later walked back slightly after internal backlash), alongside ongoing layoff pressure and AI token-usage quotas.
What stands out most isn’t just “Meta is pushing AI hard,” but how badly perverse incentives distort behavior. Once AI token consumption became a performance metric, engineers naturally gamed the metric (burning 60.2 trillion tokens in 30 days) rather than optimizing for software quality. And when AI-generated code reviewed only by AI gets pushed rapidly to production while security teams are gutted and reassigned, operational risk compounds fast: Orosz connects these dynamics to the May 30 Instagram account-takeover incident and the departure of Meta’s CISO shortly afterward. The broader lesson is not to confuse fast MTTR with system health: recovering quickly from outages cannot compensate for eroding human comprehension, weakened guardrails, and hollowed-out engineering ownership.
CS 6120: Advanced Compilers: The Self-Guided Online Course
This page hosts the self-guided version of CS 6120, Adrian Sampson’s PhD-level course at Cornell on programming language implementation and modern compilers. The curriculum progresses from core compiler foundations—intermediate representations, dataflow analysis, local and global optimizations, SSA form, and LLVM—into research-adjacent topics like dynamic compilers (JITs), garbage collection, parallelism, and fast compilation. Each lesson pairs lecture videos and written notes with classic academic papers and open-ended implementation tasks to turn abstract theory into working code.
The self-guided track preserves the linear structure of the university course while removing deadlines, grading, and internal class discussion boards. Learners follow a clear rhythm: watch the lecture, read the companion paper, and implement compiler passes using either LLVM or Bril—a small, pedagogical intermediate representation designed to be much easier to hack on than jumping straight into a production compiler—culminating in a final project. It is an outstanding resource for internalizing that a compiler isn’t just “a parser bolted onto a code generator,” but a pipeline of representation choices, program analyses, optimizations, and trade-offs between correctness, compile time, and generated code quality. The best way to use it is writing the small transformation passes yourself as you go, since compiler concepts are notoriously easy to misunderstand if you only read about them.
epoll vs io_uring in Linux
This post compares epoll and io_uring through the lens of building TinyGate, a lightweight reverse proxy in C. The first prototype used a simple thread-per-worker model that was easy to reason about but hit a hard performance ceiling; moving to epoll delivered a major speedup, yet still paid the fundamental tax of a readiness-based model: epoll only tells you when a file descriptor is ready for I/O, leaving the application to issue its own read() or write() syscalls afterward. Every I/O event therefore incurs syscall and context-switch overhead on top of epoll_ctl registration, which adds up quickly across tens of thousands of active connections.
io_uring shifts to a completion-based model: the application writes I/O requests into a submission queue in shared memory, the kernel executes them asynchronously, and results land in a shared completion queue. A single io_uring_enter() call can submit and harvest an entire batch of operations instead of paying a syscall per read()/write(). Enabling IORING_SETUP_SQPOLL can even eliminate steady-state syscalls almost entirely, at the cost of dedicating a kernel thread that spins and consumes CPU to poll the submission ring. While the author recommends considering io_uring for new high-performance Linux projects (available since Linux 5.1, though specific opcodes depend on kernel version), he cautions that production use requires care: using rings or registered buffers doesn’t automatically guarantee zero-copy I/O, errors arrive asynchronously via completion queue entries, and minimal tutorial examples omit many edge-case checks required in real servers.
This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.
Comments