Concept · Laws of software engineering
Wirth's law
Software gets slower faster than hardware gets faster, so the speed users feel tends to stand still.
Wirth's law says that software is getting slower more rapidly than hardware is becoming faster. Niklaus Wirth, the designer of Pascal, popularized it in his 1995 essay "A Plea for Lean Software", crediting the observation to Martin Reiser. Decades of faster CPUs, more memory and SSDs have made computers enormously more capable, yet many everyday tasks take about as long as they used to.
How it works
Faster hardware doesn't get spent on speed. It gets spent on everything else:
- Layers. Each abstraction (a framework, a runtime, a container, a virtual DOM) costs a little. Stack enough of them and the costs multiply.
- Features nobody removed. Every release adds code paths; few delete them. The app gets bigger even if each user only uses a fraction of it.
- Developer convenience. Shipping a whole browser engine to render a chat window is easier for the team and slower for every user.
- Nobody owns "fast". Performance is rarely anyone's metric, so it decays a few milliseconds at a time.
The developer's own machine hides all of this. A page that loads instantly on a new laptop on office Wi-Fi can take ten seconds on a mid-range phone on a weak connection.
Pushing back
Treat performance as a budget you defend, not a property you hope for:
- Know the costs. Keep the latency numbers in your head: a network round trip costs thousands of times more than a memory read.
- Set budgets and enforce them in CI. Bundle size, Core Web Vitals and p95 server latency, checked on every change.
- Test on slow hardware. Throttle the CPU and network in dev tools, or keep an old phone on your desk.
- Delete things. The fastest code is the code that doesn't run, the same instinct as not adding infrastructure you don't need.
The web performance lesson walks through measuring and fixing the biggest of these costs.