performance / the-table

performance / the-table

The table

v0.12.0 · 01 / 06 · 3 min read · docs/BENCHMARKS.md

Sizes: a medium HTML article is ~90 KB with 12 code blocks; a large one is

Sizes: a medium HTML article is ~90 KB with 12 code blocks; a large one is ~310 KB with 40. A medium Markdown document is ~26 KB (60 sections), a large one ~230 KB (400 sections). (nuevo) marks what changed in the optimization pass of 2026-10-11; the deltas are measured with the old and the new code alternating on the same session, which the single-run noise of this machine demands.

Extraction (fetch → Markdown) (nuevo: -12 a -37%)

BenchmarkBeforeAfterΔ
article small (~15 KB)5.3 ms4.7 ms-12%
article medium (~90 KB)25.7 ms16.1 ms-37%
article large (~310 KB)—~40 ms (count=3)-30%
chrome-heavy (~10 KB, 40 navs)1.2 ms~1.1 ms~-10%
Markdown passthrough (~300 KB)4.4 ms4.5 ms~0%

Load path (cache vs no cache) (sin cambio)

BenchmarkTimeAllocs
local file (~200 KB md)3.9 ms31
loopback HTTP, cache off15.5 ms26 K
cache miss (fetch + write)15.8 ms27 K
cache hit (disk, no network)2.1 ms17
cache put+get (26 KB page)0.25 ms (347 MB/s)44

Cache vs no cache is ~7.5x on this path (15.8 → 2.1 ms): the cache turns “open instantly” into a disk read plus one sanitize pass over 26 KB, with 17 allocations. The hit path does no network, no parsing and no rendering of the HTML — the Markdown was stored already extracted.

Render (Markdown → ANSI) (nuevo: -15%)

BenchmarkBeforeAfterΔ
sample fixture, 80 cols0.24 ms0.18 ms~-20%
medium doc, 100 cols2.69 ms2.28 ms-15%
large doc, 100 cols20.8 ms17.5 ms-16%
large doc, 200 cols25.0 ms~19 ms~-24%
code-heavy, 5 / 20 / 80 blocks1.8 / 7.0 / 28 ms1.5 / 6.4 / 22 ms-15/-9/-22%
re-render (chroma memoized)6.7 ms~6.5 ms~-3%
link mode: footnotes / inline / hidden2.9 / 3.0 / 2.6 ms~2.1-2.3 / 2.2-2.3 / 1.9~-25%

Interaction (what a keypress costs) (nuevo: search -65%)

BenchmarkBeforeAfterΔ
scroll keys (j k d u G g)~100 ns~100 ns0
tab (link focus)354 ns~330 ns~0
full screen draw (render)97 µs~80 µs~-15%
resize (re-render at new width)8.0 ms~5 ms~-30%
in-page search (300 sections)53.8 ms, 7.7 K allocs~31 ms, 99 allocs-42%, -99% allocs
follow a link (load + render)3.6 ms~3.5 ms~0
long document (1500 sections, load + 3 jumps)187 ms~160 ms~-15%
headless session open + close93.6 ms~93 ms~0
8 keys through a session1.7 µs~1.7 µs0

Store and search (nuevo: findMatches -48%)

BenchmarkBeforeAfterΔ
findMatches (230 KB doc)20.9 ms, 896 allocs10.8 ms, 10 allocs-48%, -99% allocs
history: 100 / 1000 / 5000 entries0.20 / 1.6 / 8.0 ms~0.17 / 1.4 / 7.5 ms~-5%
history append25 µs~40 µsnoise
bookmarks: 500 entries0.58 ms~0.49 ms~-15%

The interactive path stays what it was: ~100 ns per key with zero allocations, and a cached page open stays 2 ms. Those were never the problem.

edit this page on GitHub ↗report a problem ↗