Evaluated valyala/quicktemplate as an html/template replacement — not adopting
WHAT THE BENCHMARK MEASURES: 120ns/op vs html/template 2501ns/op on one simple template. A per-execution microbenchmark, not a page.
WHY IT DOES NOT HELP HERE. The decisive number: /api/v1/r/sqlite/file/trunk/src/btree.c — which never touches html/template — takes 703ms TTFB, SLOWER than the 461ms HTML page for the same file. The cost is blob retrieval and highlighting, not templating. Corroborating: the timeline page emits 309,584 bytes of HTML in 12ms total including ops, so template execution is bounded well under that; scaled linearly, the 2.3MB btree.c page is maybe ~90ms of template inside 461ms. A 20x cut there returns ~19% on one page type and nothing on ordinary pages. Amdahl.
WHAT IT WOULD COST. (1) Escaping: quicktemplate escapes explicitly per tag ({%s%}, {%q%}, {%u%}) — it is NOT contextual. html/template knows whether it is in an attribute, URL, JS or CSS context and escapes accordingly. quarry renders untrusted upstream content — commit messages, ticket titles and forum posts from mirrored fossil repos — so contextual auto-escaping is a security property, and swapping it for per-call discipline across a 20k-line template surface trades a class of XSS bug for percentage points. (2) A qtc codegen step and .qtpl files, where templates are currently Go constants compiled into the binary. (3) A dependency, against the smol contract.
DECISION: no. The measured bottlenecks are highlighting and blob retrieval — see the highlight cache and file-windowing tickets. Revisit only if a profile ever shows template execution dominating, which today it does not.