Skip to content
quarry Artifact [8edee5e56e]
Login

Artifact [8edee5e56e]

Artifact 8edee5e56e891abc6f0154e4feff3e376608f9acdbe4ff4edd20b999d0d9970f:

Ticket change [8edee5e56e] - New ticket [073e11ce05] Size-gate the syntax highlighter: plain text past a threshold. by ai-local on 2026-08-31 12:12:18.
D 2026-08-31T12:12:18.861
J cmimetype text/x-markdown
J comment highlight.Code\shas\sno\ssize\sgate\s—\severy\sbyte\sof\severy\sfile\sis\stokenised\son\severy\srequest,\swith\sno\scache.\n\nThe\scost\stracks\sTOKEN\sDENSITY,\snot\sfile\ssize,\swhich\sis\sthe\stell:\ssrc/sqlite.h.in\sis\sthe\slargest\sfile\sat\s559KB\sbut\sthe\sfastest\sat\s208ms\s(mostly\sdoc\scomments),\swhile\ssrc/btree.c\sis\s407KB\sof\sdense\sC\sat\s490ms\sand\sselect.c\s337KB\sat\s474ms.\sHighlighting\sdominates,\snot\sblob\sretrieval.\n\nPast\sa\sthreshold,\sskip\sthe\slexer\sand\semit\sa\splain\s<pre>.\sChroma\semits\sa\sspan\sper\stoken,\sso\sthis\sremoves\sboth\sthe\srender\scost\sand\smost\sof\sthe\s5.7x\sHTML\sblowup\s(btree.c:\s407KB\ssource\sbecomes\s2,335,223\sbytes\sof\sHTML).\sGitHub\sdoes\sexactly\sthis\sfor\slarge\sfiles,\sso\sthe\sdegradation\sis\sa\sknown,\sexpected\sone.\n\nThis\sis\sthe\scheapest\slarge-file\sfix\sand\sthe\sonly\sone\sthat\shelps\sthe\sFIRST\sview\s—\sa\scache\scannot.\sIt\sis\scomplementary\sto\sthe\shighlight\scache\s(9e53a2d9)\sand\sis\ssubsumed\slater\sby\swindowing\s(a82ff129),\swhich\shighlights\sonly\sthe\svisible\swindow.\n\nAcceptance:\sa\sfile\spast\sthe\sthreshold\srenders\sin\swell\sunder\s100ms\sas\splain\stext\swith\sa\svisible\snotice\ssaying\swhy;\sbelow\sthe\sthreshold\snothing\schanges;\sthe\sthreshold\sis\sone\snamed\sconstant.
J priority High
J severity Important
J status Open
J subsystem web
J title Size-gate\sthe\ssyntax\shighlighter:\splain\stext\spast\sa\sthreshold
J type Feature
K 073e11ce0566ae41edd6f8515773081afbcd54a9
U ai-local
Z afa9cfe26cc6c3ef82c8e5c4e8d05edd