Skip to content
quarry History Of Ticket 61417e834bebf399d0d2f0a7961da35bcf7563da
Login

History Of Ticket 61417e834bebf399d0d2f0a7961da35bcf7563da

Artifacts Associated With Ticket 61417e834bebf399d0d2f0a7961da35bcf7563da

  1. Ticket change [3d210fc96a] (rid 4468) by ai-local on 2026-08-31 11:54:08:

    1. Untracked field cmimetype: "text/x-markdown"
    2. 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.
      
    3. priority initialized to: "Low"
    4. severity initialized to: "Minor"
    5. status initialized to: "Closed"
    6. subsystem initialized to: "web"
    7. title initialized to:
      Evaluated valyala/quicktemplate as an html/template replacement — not adopting
      
    8. type initialized to: "Feature"
  2. Ticket change [116eb08c23] (rid 12554) by zeitgeist on 2026-09-24 00:55:42:

    1. Untracked field number: "118"