Skip to content

Record the marking time of each minor and major GC in harness-gc - #569

Open
thomasklemm wants to merge 1 commit into
ruby:mainfrom
thomasklemm:thomasklemm/gc-time-by-collection-type
Open

thomasklemm wants to merge 1 commit into
ruby:mainfrom
thomasklemm:thomasklemm/gc-time-by-collection-type

Conversation

@thomasklemm

@thomasklemm thomasklemm commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

These columns show changes to the marking cost of one collection, which iteration time and GC time per iteration miss. ruby/ruby#19685 marks each ZJIT JITFrame ISEQ once per GC. With ZJIT, over three rounds with one process per build, it lowered the mean marking time of one minor GC by 49–59% on railsbench, 8–10% on lobsters and 23–33% on shipit, compared with master in the same round. Two master processes differed by at most 9%, and iteration time and GC time per iteration didn't separate the patch from them. I measured this with a script that reads the same GC::Profiler records.

On Ruby 4.1, GC::Profiler records each collection's marking time (ruby/ruby#17431). --harness=gc now keeps it per iteration for minor and major collections, as mark ms/minor and mark ms/major and their ratios, with one --pvalue sample per iteration. Ruby 4.0 and TruffleRuby output doesn't change.

This complements XrXr's #562, which removes GC time from the timings. Once eightbitraptor's #541 lands, its GC per ruby table shows these columns too. Both change lib/benchmark_runner.rb; if #541 lands first, I'll rebase this onto it.

On Ruby 4.1, GC::Profiler records the marking wall time of each
collection. harness-gc now keeps it per iteration, split into minor and
major collections, and the GC tables show the average marking time of
one minor and one major collection. A major GC landing in a different
iteration no longer hides a change to the cost of a minor one, which is
where root-marking changes show.
@thomasklemm
thomasklemm marked this pull request as ready for review November 5, 2026 20:19
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