|
Pretext
@chenglou/pretext (Cheng Lou)
|
DOM text measurement & forced layout reflow (offsetHeight, getBoundingClientRect) |
One-time Canvas glyph width segmentation |
60fps obstacle & resize reflow (sub-ms pure math) |
Zero DOM reads on hot path |
pretext.html ↗ |
|
PrePath
SVG Geometry & CSR Grid
|
Blink/Skia C++ SVG DOM calls (getPointAtLength, isPointInStroke, getBBox) |
16.4 ms (500 paths) · 115.5 ms (2,000 paths) |
135×–267× point · 1,113×–7,447× hit-test |
0 B/query via reusable out structs |
prepath.html ↗ |
|
PreDAG
Flat-CSR Sugiyama DAG
|
Full object-graph Sugiyama rebuilds (rank, dummies, crossings) on every node resize |
1.39 ms (500 nodes) · 17.5 ms (2,000 nodes) |
68×–78× (PAVA) · 297×–516× (center) |
0.0 KB/call vs 3.88 MB/call |
predag.html ↗ |
|
StreamDiff
Streaming LLM Code Diff
|
O(N³) per-token full-file Myers diffing & red-deletion tail flicker |
1.96 ms (1.2k lines) · 4.67 ms (3k lines) |
787×–4,162× hot vs per-line (180×–833× vs 5-line) |
95%+ O(1) FNV-1a fast-path · 0 flicker |
streamdiff.html ↗ |
|
WorkerSlab
Zero-Copy Columnar Slab
|
postMessage V8 Structured Clone stalls & O(N log N) JS Array.sort |
Direct-to-slab on Worker (7.81 MB / 100k rows) |
479×–656× E2E transfer · 17×–41× sort |
+0.027 MB main heap vs +29.7 MB |
workerslab.html ↗ |
|
PreMasonry
Pretext + Float32 Masonry
|
DOM masonry height probes (offsetHeight forced reflow) & full 5k-node DOM trees |
697 ms (5,000 mixed image+text cards via Pretext) |
181.0× faster (4.20 ms vs 760.38 ms avg) |
~9–15 mounted DOM nodes · O(cols·log N) search |
premasonry.html ↗ |
|
PreTimeline
LOD Mipmap Flamegraph
|
O(N) full-span canvas draws & linear hit-testing across 100,000 intervals (24 lanes) |
Flat TypedArrays + maxEndPrefix + 6-level LOD |
134.2× (10h LOD) · 42.4× (10m) · 6.7× (1ms) |
0 hot-path allocs · <1.5px sub-pixel clustering |
pretimeline.html ↗ |
|
PreHit
2D Affine OBB + CSR Grid
|
DOM getBoundingClientRect() thrash & AABB corner false positives on rotated cards |
16.40 ms (2,000 rotated cards + 27×16 CSR grid) |
40.3× determ. (0.20 vs 8.05 ms) · 56.8× live |
0 allocs · Uint32Array dedup · exact SAT OBB |
prehit.html ↗ |
|
PreScroll
Fenwick Virtual Scroll
|
O(N) prefix-sum rebuilds & scroll jitter under live streaming variable-height mutations |
O(N) bottom-up Float64Array Fenwick Tree (100k rows) |
468×–573× Chromium · 2,053× Node (0.02 ms) |
0 hot-path allocs · O(log N) binary lifting |
prescroll.html ↗ |
|
PreSyntax
Stateful Incremental Lexer
|
Full-file O(N) re-tokenization on every keystroke across 5,000-line TypeScript files |
Bit-packed Uint32Array (30,628 tokens) + EOL states |
1,168× single-line edit (0.010 vs 11.68 ms) |
1/5,000 lines touched · exact 17-line /* exit |
presyntax.html ↗ |
|
PreCalc
100k-Cell RPN Spreadsheet DAG
|
Recursive AST formula evaluation & diamond re-evals across 100,000 spreadsheet cells |
Kahn topo-permuted RPN bytecode + CSR edges (128k edges) |
63.2× Chromium (0.77 vs 48.48 ms · 14k dirty cone) |
0 hot-path allocs · L1 2-level bitset PQ |
precalc.html ↗ |
|
PreGrep
Flat-CSR Trigram Log Search
|
O(N) .includes() & RegExp.test() full scans across 200,000 log lines |
1,188 ms (200k lines · 46.4 MB UTF-8 arena + 18-bit CSR) |
145.1× substr (0.88 vs 128.2 ms) · 97.7× regex |
0 hot-path allocs · 4-line superblock postings |
pregrep.html ↗ |
|
PrePoly
CSR Grid + Y-Slab Choropleth
|
O(N·V) GeoJSON polygon scans & divisions on 5,000 concave polygons w/ 1,000 holes |
83–91 ms (18.6 MB CSR grid + division-free Y-slabs) |
4,496×–5,213× Chromium · 10,058× Node (2.98 ms / 10k pts) |
0 hot-path allocs · unified outer+hole parity |
prepoly.html ↗ |
|
PreFacet
Bitset + Prefix-XOR BI Engine
|
Full-table .filter() & recount stalls across 250k BI rows, 6 cat dims & 2 ranges |
150.7 ms (250k rows · 4-pass LSD radix + prefix-XOR) |
78.8× Chromium (1.77 vs 139.3 ms) · 70.9× Node |
0 hot-path allocs · 16-bit POP16 bitset AND |
prefacet.html ↗ |
|
PreWave
10M-Sample Min/Max Pyramid
|
O(N) linear min/max scans over 10,000,000 Float32 audio/market samples per zoom frame |
253.4 ms (9.54 MB 21-level pyramid · 25% overhead) |
436.6× mip (0.106 vs 46.3 ms) · 660.1× Node |
0 hot-path allocs · 0 dropped peaks · 12.2 µs update |
prewave.html ↗ |
|
PreLabel
Tile-CSR + Bitmask Labeler
|
O(N log N) sort + O(N²) overlap checks across 50,000 map & star-catalog labels |
58 ms (64×64 World-Tile Priority CSR + 8×8 bitmasks) |
97.9× Chromium (0.53 vs 51.9 ms) · 132.6× Node |
0 hot-path allocs · mask + priority overrides |
prelabel.html ↗ |
|
PreBin
Zero-Parse Binary & Shards
|
JSON.parse() startup stalls, GC heap bloat & monolithic payload downloads (35k rows) |
One-time packColumnar() / 256-bucket packShards() |
529× boot (0.10 vs 52.88 ms) · 233× less shard I/O |
+0.003 MB heap (0 JS objs) · 58% smaller payload |
prebin.html ↗ |
|
PreBatch2D
Color-Bucketed 2D Canvas
|
Per-node beginPath/arc/fill C++ state thrash across 35,000 2D nodes & idle rAF burn |
17.3 ms (35k nodes · 20 color buckets + 20×16 CSR tiles) |
120.1× full-view (4.70 vs 564.7 ms · 20 vs 35k draws) |
1,749× fewer draw calls · 0% idle CPU sleep |
prebatch2d.html ↗ |
|
PreGraph
CSR Bi-BFS & Ego-Nets
|
Naive Map/Set BFS allocations & full-component scans on 30k-node graphs |
17.4 ms (30k V · 55k E · flat CSR + 1,051 compIds) |
23.5× Bi-BFS (0.27 vs 8.5 ms) · 17,400× disc. guard |
0 hot-path allocs · gen-stamped scratch + masks |
pregraph.html ↗ |
|
PreArc
Analytic Quadratic Bezier
|
SVG d-string re-serialization & 28-segment polyline flattening on dynamic arc hubs |
0.068 ms (250-arc dynamic hub recompile · 68 KB flat) |
12.4× recompile (0.068 vs 0.844 ms) · 4.7× combined |
0 hot-path allocs · exact depressed-cubic hit-test |
prearc.html ↗ |