Repository navigation
Record the marking time of each minor and major GC in harness-gc - #569
Open
thomasklemm wants to merge 1 commit into
Open
thomasklemm wants to merge 1 commit into
thomasklemm wants to merge 1 commit into
Conversation
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
marked this pull request as ready for review
November 5, 2026 20:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::Profilerrecords.On Ruby 4.1,
GC::Profilerrecords each collection's marking time (ruby/ruby#17431).--harness=gcnow keeps it per iteration for minor and major collections, asmark ms/minorandmark ms/majorand their ratios, with one--pvaluesample 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.