AI-driven compiler optimization spree: JSON.parse up to 2.9x faster, shift now linear

cramforce · x · 2026-10-18

cramforce shares a progress board of AI-collaborated PRs optimizing a TS type-stripping compiler (continuing the thread on having Claude recursively optimize deps), inviting "token donations". Merged: #1193 direct JSON schemas — typed JSON.parse 1.9-2.9x faster on realistic schemas, 30-40% less memory, 18/20 sample schemas now take the fast path; #1195 shift/unshift draining a queue goes from O(n²) to linear (100k elements: 847ms → 1.6ms); #1196 reference-count borrowing cuts retain/release 50-86%, ast-interp 3x faster; #1199 Int32[] contracts make annotated integer kernels 3.6-6.2x faster, near Node parity. Pending review: #1194 regions work across await (async requests 2130ms/995MB → 668ms/8.9MB); #1203 stack-buffer string slices 11-25% faster parsing. In CI: #1204 stackless async 7-20x faster concurrent async with 5-8x less memory, beating Node on every async benchmark; #1205 value records 38-67% faster; #1206 call-site specialization 45% faster callback helpers. He notes a package manager fetching original types from GitHub (available a good percentage of the time) would make this a truly solvable problem.

Original post →

More from coding & agent

coding & agent channel →