-
Notifications
You must be signed in to change notification settings - Fork 224
Parsing performance #2652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Parsing performance #2652
Conversation
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.
|
Another thought: How much time do we spend computing assertions? Should we disable them in "release" mode? Currently, Lines 8 to 19 in 4baf465
Perhaps we should rename the function to For comparison, C's standard library's |
Another thought: our rbs/ext/rbs_extension/extconf.rb Line 21 in 4baf465
But we never specify |
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.