It goes to eleven
summary
Argues that generating code at runtime and compiling it with new Function yields major speedups for repeated validation and queries, not just theoretical fluff. Builds a JSON-query interpreter that compiles schemas into inlined checks using generate-function and generate-object-property, and benchmarks show progression from 668 matches/ms (closure baseline) to ~11,000 with a compiled closure and ~35,000 with generated functions. The technique powers is-my-json-valid style validators and works when the seed/schema changes infrequently.
AI-written summary · about
chapters (5)
- 0:00Start
- 0:52How To Write Code That Writes Code
- 15:44Generate Object Property
- 16:18Generator Object Property
- 16:39Generate Function
related talks
31mJavaScript Compilation Techniques or "Wasn't JavaScript supposed to be slow?"
29mExtreme JavaScript Performance
58mImproving Quality of JavaScript Code
49mGoing Functional with JS
23mGraphQL - Accelerated
32mBuilding a High Performance JavaScript Compiler
31mJavaScript Compilers For Fun and Profit
41mBenchmarking JavaScript
