Big-O Notation
A coarse language for how an algorithm's cost grows as its input grows.
Big-O notation describes an upper bound on how a cost — running time or memory — grows with input size, discarding constant factors and lower-order terms. A routine is O(n log n) if, past some size, its cost stays within a constant multiple of n log n.
The coarseness is the point. Constants depend on the processor, the compiler, and the runtime; the growth term does not, so the claim survives a hardware refresh. That is why Binary Search is called logarithmic without reference to any machine.
Three columns, not one. Quicksort is O(n log n) on average and O(n²) on adversarial input; a Hash Table lookup is constant on average and linear at worst. Quoting only the flattering column is a small Exhaustive Claim — the workload that produces the bad column is what a reader needs.
Where it misleads. At small n the discarded constants dominate, which is why production sort routines fall back to insertion sort below a threshold. The model also assumes every operation costs the same, and memory hierarchies do not oblige: a linear scan over contiguous memory beats an asymptotically better structure chasing scattered pointers, so the behavior of a Least Recently Used Cache can matter more than the exponent. Amortized bounds hide spikes — appending to a growable array is constant amortized and occasionally linear when it resizes, which is fine for throughput and bad for tail latency.
It is a vocabulary for reasoning, not a measurement. Treating it as a proxy for observed speed is Goodhart's Law in miniature; the Ground Truth is Instrumentation on representative input.
See also5
Binary Search
Finding a value in a sorted range by repeatedly discarding half of it.
Computation & Algorithms10 connections
Hash Table
A key-value structure that uses a digest of the key to index an array of buckets.
Computation & Algorithms17 connections
Performance Budget
A committed numeric ceiling on a page's cost, enforced automatically.
Web Platform22 connections
Observability
How much of a system's internal state can be inferred from what it emits.
Method24 connections
Determinism
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
Systems & Tooling56 connections
Linked from12
- Amortized AnalysisComputation & Algorithms
Averaging cost over a sequence of operations so occasional expensive ones don't distort the per-operation bound.
- B-TreeComputation & Algorithms
A self-balancing tree with many children per node, designed to minimize the number of disk reads a lookup costs.
- Binary SearchComputation & Algorithms
Finding a value in a sorted range by repeatedly discarding half of it.
- Dynamic ProgrammingComputation & Algorithms
Solving a problem by solving each distinct overlapping subproblem exactly once and reusing the results.
- Factory GamePlay & Games
A genre whose core verb is building the machine that plays the game, turning the player into a systems engineer.
- Fermi EstimationMethod
Reaching a defensible order-of-magnitude answer by decomposing a question into estimable factors.
- Hash TableComputation & Algorithms
A key-value structure that uses a digest of the key to index an array of buckets.
- Idle GamePlay & Games
A genre in which progress continues while the player is absent, built on exponential curves the player learns to read.
- Least Recently Used CacheComputation & Algorithms
A fixed-capacity cache that evicts whichever entry has gone untouched the longest.
- Network EffectMeaning & Society
A good whose value to each user grows as more people use it.
- Premature OptimizationMethod
Spending effort making code fast before you know where it's actually slow trades clarity for speed you may not need.
- TrieComputation & Algorithms
A tree that stores strings by shared prefix, so each node represents a prefix all its descendants extend.