Skip to content

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Sep 2, 2025

This is related to the RBS file parsing performance degradation.

The RBS file parsing in rbs-4.0 (dev) is ~5x slower than rbs-3.9, based on the core/**/*.rbs files, especially for smaller files.

https://docs.google.com/spreadsheets/d/1dQBGIC1_zWco6c5OHH5VunP8ZuZLzwaMDB-U31OgUAc/edit?gid=0#gid=0

I implemented minor changes to improve the parsing performance, reusing empty array and hash objects. The changes improved the parsing performance slightly, but it still clearly slower than rbs-3.9.

Add prepare_bench task
`bundle exec ruby benchmarks.rb core/**/*.rbs`
This is a prototype which doesn't `munmap` the heap. Introducing parser class to manage the allocators and changing the parsing methods to instance methods should allow releasing the heap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant