"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%."

— Donald Knuth

The Problem: Vibe Coding in the Age of AI

AI-assisted coding has fundamentally changed software development. Within minutes, you can generate working code for complex problems. But there's a trap lurking beneath this unprecedented productivity: vibe coding—the practice of iterating with AI until something "works" without understanding why it works or how well it works.

Consider a real problem: building an on-call scheduling system for surgeons at a hospital. Someone needs to be available 24/7/365. Thanksgiving call is brutal—nobody wants it, but someone must take it. A mid-week holiday creates moderate burden; a 3-day weekend significantly more. Three consecutive weeks of call might feel equivalent to two workweeks that include 3-day weekends. How do you balance this fairly?

This is fundamentally similar to the traveling salesman or knapsack problem—NP-complete territory where naive algorithms explode exponentially. Vibe coding will give you a solution. It might even look elegant. But when the surgical department grows from 8 to 20 attendings, or when you need to optimize call swaps mid-year, that elegant solution may become computationally intractable.

The deeper issue isn't the algorithm. It's what happens beneath the algorithm.

· · ·

The Hidden Cost of Ignorance

Imagine you've designed a sophisticated burden-scoring system:

Call TypeBurden Score
Regular weekday1.0
Mid-week holiday1.1
3-day weekend1.5

You implement it with floating-point arithmetic because that's what feels natural. Your algorithm computes millions of schedule permutations, comparing burden scores to find optimal distributions.

Now consider the same scores expressed differently:

Call TypeBurden Score (Integer)
Regular weekday10
Mid-week holiday11
3-day weekend15

Mathematically identical. Computationally? Night and day.

Floating-point operations require your CPU to perform complex mantissa and exponent manipulations. Integer operations are simple register arithmetic. On a modern processor, this difference might be 4-10× for scalar operations. But here's where it becomes dramatic: modern CPUs have SIMD (Single Instruction, Multiple Data) capabilities like AVX-512 that can process 16 32-bit integers simultaneously. Your burden comparison is trivially parallel—you're comparing independent schedule configurations. With integer scoring, you can evaluate 16 schedules in the time it takes to evaluate one with naive floating-point code.

The AI that helped you write the floating-point version has no concept of this. It generated syntactically correct, logically sound code that runs orders of magnitude slower than it could.

· · ·

Digital Physics: The Curriculum

We call this discipline Digital Physics because understanding modern computing requires knowing the physical realities of how computation occurs. Not in the abstract "algorithms have complexity" sense, but in the concrete "your data traverses actual silicon at actual speeds" sense.

When Jeff Dean and Sanjay Ghemawat—two of Google's most legendary engineers—compiled their performance wisdom, they began with this table of approximate operation costs:

OperationTime
L1 cache reference0.5 ns
L2 cache reference3 ns
Branch mispredict5 ns
Mutex lock/unlock15 ns
Main memory reference50 ns
Compress 1KB (Snappy)1 µs
Read 4KB from SSD20 µs
Datacenter roundtrip50 µs
Read 1MB from memory64 µs
Read 1MB over 100Gbps100 µs
Read 1MB from SSD1 ms
Disk seek5 ms
Read 1MB from disk10 ms

Study these numbers. A main memory reference costs 100× more than an L1 cache hit. A disk seek costs 10 million times more than an L1 cache reference.

This isn't trivia. This is the physics of your computer. Every design decision—how you lay out your data structures, whether you use a hash map or a sorted array, how you batch your operations—has consequences measured against these physical constants.

The Gap We Fill: Google's Abseil project publishes exceptional performance hints derived from decades of engineering real systems at massive scale. The problem? They're written for an audience that probably doesn't need them—senior engineers who already have the foundational intuition.

When Dean and Ghemawat write about cache-line contention or arena allocation, they assume you already know what a cache line is, why contention matters, and what an arena allocator does. They provide optimization tactics without the strategic foundation.

· · ·

What You Will Learn

The Academy organizes knowledge into interconnected modules:

The Memory Hierarchy

  • CPU caches (L1/L2/L3): structure, associativity, eviction
  • Cache-conscious data structure design
  • Prefetching: when it helps, when it hurts
  • The cost of pointer-chasing vs. sequential access

Data Representation

  • Integer vs. floating-point: when and why
  • Data layout: AoS vs. SoA
  • Alignment and padding
  • Compact representations and when to use them

Concurrency & Parallelism

  • Thread-level parallelism: costs of synchronization
  • SIMD/Vector processing: AVX, NEON, SVE2
  • False sharing and cache-line contention
  • Lock-free techniques and their trade-offs

Algorithmic Considerations

  • Complexity classes and constant factors
  • When O(n²) beats O(n log n) in practice
  • Cache-oblivious algorithms
  • Approximation when exactness isn't required

The Estimation Mindset

Perhaps most valuable: developing the intuition to estimate performance characteristics before writing code. Back-of-envelope calculations using the numbers in that table above. Should you cache this result? How much data can you process per second? When does algorithmic improvement matter more than constant-factor optimization?

We draw heavily on the hard-won wisdom of Google's Abseil project, but we don't stop there. We integrate knowledge from game engine development, high-frequency trading systems, scientific computing, and embedded systems—anywhere that programmers have been forced to understand the machine beneath the abstraction.

· · ·

The Ultimate Goal

When you complete this curriculum, you won't just write faster code. You'll think differently about code before you write it. You'll recognize when vibe coding is perfectly appropriate (prototypes, scripts, low-traffic services) and when it will create technical debt that compounds over time.

You'll look at a problem like surgical call scheduling and immediately think: "This is NP-hard, but the search space is tractable with pruning. I need integer scoring for SIMD optimization. My data fits in L2 cache, so I can afford multiple passes. The fairness metric needs to be precomputable..."

That's digital physics. That's what separates engineers who write code from engineers who build systems.

Enter the Academy
AD

Alan B.C. Dang, MD

Health Sciences Clinical Professor of Orthopaedic Surgery, UCSF · Staff Surgeon, San Francisco VA Health Center