Making the RBS Parser Faster
summary
RBS parser work focuses on concrete wins: lexer byte-width caching speeds core RBS parsing ~16% and fixes non-UTF-8 behavior, and switching the arena from mmap to a malloc-based arena eliminates repeated page faults so the new C parser runs up to 1.67× faster than RBS 3.9 overall and recovers a ~10× slowdown on many tiny inputs. Investigation uses Instruments profiler and a re2c lexer; benchmarks cover core, Steep, Rails timing, and smallest/ largest file sets.
AI-written summary · about
chapters (7)
- 0:00Introduction and updates
- 5:11RBS parser overview
- 9:25Profiling and lexer issues
- 15:15Encoding and lexer fixes
- 19:31Custom allocator optimization
- 25:15Final performance results
- 26:59Conclusion and future
related talks
22mStatic typing with RBS in Ruby
39mIDE development with Ruby
43mGrammars, Parsers, and Interpreters, In Ruby
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
44mConsuming Gherkin: One Byte at a Time
32mParsing Ruby
46mRuby3: What's Missing?
48mRapid Programming Language Prototypes with Ruby RACC
