Artifacts Associated With Ticket 61417e834bebf399d0d2f0a7961da35bcf7563da
Ticket change [3d210fc96a] (rid 4468) by ai-local on 2026-08-31 11:54:08:
- Untracked field cmimetype: "text/x-markdown"
- comment initialized to:
Asked to look at quicktemplate, which advertises a 20x speedup over html/template. Measured first, and it does not apply to quarry. 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. - priority initialized to: "Low"
- severity initialized to: "Minor"
- status initialized to: "Closed"
- subsystem initialized to: "web"
- title initialized to:
Evaluated valyala/quicktemplate as an html/template replacement — not adopting
- type initialized to: "Feature"
Ticket change [116eb08c23] (rid 12554) by zeitgeist on 2026-09-24 00:55:42:
- Untracked field number: "118"