Research & Discovery Log
Objective: Trace the chronological record, origins, and conflicting accounts of the quote "premature optimization is the root of all evil."
Discovery Phase 1
Initial Attribution & The Hoare Denial
- Initial search executed to parse the relationship between Donald Knuth and Sir Tony (C.A.R.) Hoare regarding the quote.
- Discovered a pivotal 2004 blog post by Hans Gerwitz. Gerwitz queried Tony Hoare directly about the quote via email in January 2004.
- Hoare replied: "I'm sorry I have no recollection how this quotation came about. I might have attributed it to Edsger Dijkstra. I think it would be fair for you assume it is common culture or folklore".
- This officially eliminates Hoare as the originator and introduces a conflicting folklore attribution to Edsger W. Dijkstra.
Discovery Phase 2
Locating the Primary Sources
- Unearthed the definitive first appearance of the quote: Donald Knuth's paper "Structured Programming with go to Statements", published in ACM Computing Surveys, Vol 6, No. 4, December 1974 (page 268).
- Identified the full, un-truncated quote: "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%".
- Discovered a secondary contemporaneous use: Knuth's 1974 Turing Award lecture, "Computer Programming as an Art" (Communications of the ACM, Dec 1974, p.671), where he used a slight variant: "premature optimization is the root of all evil (or at least most of it) in programming".
Discovery Phase 3
Tracing the Misattribution & The 1972 Connection
- Investigated why Hoare is so frequently credited if Knuth definitively published it in 1974. Found the source of the error: Donald Knuth himself in his 1989 paper "The Errors of TeX", where he mistakenly called it "Hoare's dictum."
- Dug deeper into the relationship between Knuth, Hoare, and Dijkstra. Discovered the critical missing link: the 1972 book "Structured Programming," co-authored by Dijkstra, Hoare, and Ole-Johan Dahl.
- Found that Knuth wrote a formal 40-page review of this exact book in 1973. This explains perfectly why Knuth's memory of the phrase became entangled with Hoare and Dijkstra decades later—they were the authors of the foundational text he was actively responding to.
Discovery Phase 4
Uncovering the Historical Context (The `goto` Debate)
- Analyzed the 1974 paper's context. Knuth wrote it to synthesize the purist theories of the 1972 Structured Programming book with the harsh performance realities of 1970s hardware.
- Noted a deep irony: Developers today often credit Dijkstra, but Knuth actually coined the phrase in a paper defending the occasional, highly-optimized use of the
goto statement—a direct challenge to Dijkstra's strict purist views introduced in 1968.
Discovery Phase 5
Investigating the Empirical Basis (The 97% / 3% Split)
- Looked into where Knuth derived the "97% / 3%" figures. Discovered this was not rhetorical. It was based on empirical profiling, specifically Knuth's own analysis of Fortran programs.
- The data showed execution time is highly disproportionate to code volume. A tiny fraction of the code (the 3% "inner loops") accounts for the vast majority of execution time.
- "Premature" specifically meant optimizing based on programmer intuition before utilizing measurement tools to actually locate that 3%.
Discovery Phase 6
Analyzing Original Intent vs. Modern Exaggeration
- Researched how the quote is interpreted today. It is overwhelmingly truncated to just the second half and used as a "thought-terminating cliché" to avoid profiling or optimizing code altogether.
- Contrasted this with Knuth's original text. Knuth explicitly demanded that engineers must aggressively optimize the "critical 3%" of their programs, while warning against micro-optimizations that ruin readability in the 97% of code that rarely executes.