Optimizing Performance using a VM and Go Plugins
summary
Builds a stack-based VM bytecode compiled from parsed ASTs and a runtime with object pools, plus a transpiler that emits Go and uses Go plugins (buildmode=plugin) to load compiled run() symbols. Baseline interpreter runs ~92.5s for 100M formulas; removing double-parsing and adding pools drops cost to ~30–14.6µs/op; VM with pooling is ~14.6µs/op; plugins hit ~9.5µs/op — about a 10× speedup over original — but each plugin takes ~0.9–1.0s to compile and load.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:41Agenda
- 1:47Spreadsheets
- 2:55Lexing
- 7:34Parsing
- 12:47Spreadsheet
- 13:30Calculation Engine
- 20:55Performance Monitoring
- 23:22Performance Improvement
- 27:19Compile Node
- 29:58VM Runtime
- 33:33VM Performance
- 41:05Go Plugin
- 44:06Lessons Learned
related talks
40mCreating efficient VM with JIT in Go
44mImplementing Software Machines in Go and C
29mAutomatically Generated Supernodes for AST Interpreters Improve Virtual-machine P...
48mOne VM To Rule Them All
40mJoy of Meta-Tracing Just-in-Time Compilation: More Than Just a VM Generator
17mAST vs. Bytecode: Interpreters in the Age of Meta-Compilation
44mBuild Your Own VM with JIT Compilation for Dummies
29mGraalVM in a Nutshell
