Feature #22630
openGC improvements
Description
I was playing around with options to reduce GC time/cost. It seems to be one of the biggest things we hit in our app.
In doing so, Claude was able to find 4 changes that could dramatically reduce GC time on a warmed up host (it pointed to an 80x win, which I'm dubious about). I'll link them below as I open the PRs.
https://github.com/ruby/ruby/pull/20097
- improvements to gc_mark, with 4 changes that help with the fixed per-call costs
https://github.com/ruby/ruby/pull/20098
- prefetch the gc_update_weak_references for 32 references ahead
https://github.com/ruby/ruby/pull/20099
- prefetching children during full marks
https://github.com/ruby/ruby/pull/20100
- opt-in RUBY_GC_PERMANENT_GENERATION setting, making full_mark GCs much faster
Updated by fuzzyrichie-gusto (Richard Desmarais) 3 days ago
- Description updated (diff)
Updated by byroot (Jean Boussier) 1 day ago
No opinion on either patch, but:
to reduce GC time/cost. It seems to be one of the biggest things we hit in our app.
I assume you're not using GC.config(rgengc_allow_full_mark: false) ? Any reason why?
Updated by fuzzyrichie-gusto (Richard Desmarais) about 18 hours ago
We're just about to test it out, which we know will help. We tried a GC.disable approach originally and got hosed on that, so this was the recommendation afterwards.