Delete GC tuning variables from the environment#386
Conversation
st0012
left a comment
There was a problem hiding this comment.
I think we may want to delete RUBYOPT too as it doesn't make sense for the LSP server to take it anyway.
For example, ruby/debug users could inject RUBYOPT into their shell config following the official recommendation. This means ruby-lsp would require that prelude.rb as well. Even though in this case loading that file shouldn't break ruby-lsp, it still highlights the risk of taking RUBYOPT.
|
I agree, but that might require a more complex check. If I'm not mistaken bundler itself adds some requires using |
| "RUBY_GC_MALLOC_LIMIT", | ||
| "RUBY_GC_HEAP_GROWTH_MAX_SLOTS", | ||
| "RUBY_GC_OLDMALLOC_LIMIT", | ||
| "RUBY_GC_HEAP_INIT_SLOTS", |
There was a problem hiding this comment.
Other than looking at the Ruby source, is there somewhere that documents all the available variables? Google isn't returning anything useful.
There was a problem hiding this comment.
The most sensible thing might be to remove all the env var that start with RUBY_GC_*, since we introduced new ones in Ruby 3.3.0-dev already, it would be more future proof.
There was a problem hiding this comment.
| "RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR", | ||
| "RUBY_GC_HEAP_FREE_SLOTS", | ||
| "RUBY_GC_HEAP_SLOTS_GROWTH_FACTOR", | ||
| "RUBY_GLOBAL_METHOD_CACHE_SIZE", |
There was a problem hiding this comment.
So this env var has no longer any effect since Ruby 3.0, you can ignore it. I also recently removed it from core.
…p-minitest-0.25.0 Bump rubocop-minitest from 0.24.0 to 0.25.0
Sometimes developers may use Ruby's GC tuning environment variables to calibrate their application's performance. However, this is often not adequate for the Ruby LSP and usually results in spending an insane amount of time doing garbage collection.
There might be an opportunity to tune these specifically for the Ruby LSP to output better performance, but for the time being we should at least remove those and use defaults, which greatly improves performance where GC has been tuned.