Making the RBS Parser Faster
At the last RubyKaigi, a talk introduced a major overhaul of the RBS parser, making it more portable so that it could be reused by other tools such as Sorbet. After the new parser was merged into the main branch, an issue was reported indicating roughly a 10% performance regression compared to the RBS 3.9 parser.
However, this was not the worst case. We soon noticed that, for smaller files, the new parser could be up to five times slower than the previous implementation.
In this talk, I will walk you through a short journey of making the RBS parser faster by profiling the implementation, clarifying undocumented assumptions, and improving the parser implementation in C.
-
Soutaro MatsumotoSoutaro is a Ruby core committer who leads the development of RBS and develops Steep – a static type checker built on top of RBS. He works at Shopify as a Senior Engineer on the Ruby DX team.