Empiriceme · Figure · Adage / Folk Law

Knuth's Law

Also called Premature optimisation is the root of all evil

Premature optimisation is the root of all evil; measure before tuning.

Knuth wrote it in 1974 and later referred to it as Hoare's dictum, though no secure earlier source in Hoare has been established. The full quote allows that the remaining 3% of cases genuinely warrant optimisation.

In practice

  • A team spends three weeks caching a query that runs twice a month, while the daily report nobody profiled takes nine minutes.
  • A household insulates the loft before finding that most of the heat leaves through a single unglazed door.
Standing
Knuth later called it Hoare's dictum, but no secure earlier source in Hoare has been established, so Hoare should not be credited without qualification.
Subject
Technology & Software
Essay
The programmers' folklore, and technology's place in society

Search every entry·Every entry, A to Z