diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-02-14 15:55:25 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-02-21 08:05:31 -0500 |
commit | 93ac7405b80cc61930d73da04441fa09af1851e1 (patch) | |
tree | 03b5a1f70186beee0b1dd01a44dfeda47f11d237 /gc.rb | |
parent | d7c1ca48bf7754a23bfe1559422736029b4787a0 (diff) | |
download | ruby-93ac7405b80cc61930d73da04441fa09af1851e1.tar.gz |
Add marking and sweeping time to GC.stat
There is a `time` key in GC.stat that gives us the total time spent in
GC. However, we don't know what proportion of the time is spent between
marking and sweeping. This makes it difficult to tune the GC as we're
not sure where to focus our efforts on.
This PR adds keys `marking_time` and `sweeping_time` to GC.stat for the
time spent marking and sweeping, in milliseconds.
[Feature #19437]
Diffstat (limited to 'gc.rb')
-rw-r--r-- | gc.rb | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -282,7 +282,7 @@ module GC # Return measured \GC total time in nano seconds. def self.total_time Primitive.cexpr! %{ - ULL2NUM(rb_objspace.profile.total_time_ns) + ULL2NUM(rb_objspace.profile.marking_time_ns + rb_objspace.profile.sweeping_time_ns) } end end |