[ruby-core:112427] [Ruby master Feature#19437] Add marking and sweeping time to GC.stat

Issue #19437 has been reported by peterzhu2118 (Peter Zhu). ---------------------------------------- Feature #19437: Add marking and sweeping time to GC.stat https://bugs.ruby-lang.org/issues/19437 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal ---------------------------------------- Pull Request: https://github.com/ruby/ruby/pull/7304 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. -- https://bugs.ruby-lang.org/

Issue #19437 has been updated by rubyFeedback (robert heiler). \o/ ---------------------------------------- Feature #19437: Add marking and sweeping time to GC.stat https://bugs.ruby-lang.org/issues/19437#change-101875 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal ---------------------------------------- Pull Request: https://github.com/ruby/ruby/pull/7304 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. -- https://bugs.ruby-lang.org/

Issue #19437 has been updated by AMomchilov (Alexander Momchilov). Hey Robert, I appreciate your excitement, but could you please refrain from commenting unless it's meaningfully contributing to the discussion? You can up-vote this issue by clicking "like" in the top right corner? ---------------------------------------- Feature #19437: Add marking and sweeping time to GC.stat https://bugs.ruby-lang.org/issues/19437#change-101878 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal ---------------------------------------- Pull Request: https://github.com/ruby/ruby/pull/7304 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. -- https://bugs.ruby-lang.org/

Issue #19437 has been updated by rubyFeedback (robert heiler).
You can show your support for this issue by clicking "like" in the top right corner
Aha - I did not notice that before.
could you please refrain from commenting unless it's meaningfully contributing to the discussion?
This is a situational question, though, as to what is to be considered "meaningful". I don't mind using the "Like" part though; I did not notice this before. ---------------------------------------- Feature #19437: Add marking and sweeping time to GC.stat https://bugs.ruby-lang.org/issues/19437#change-101971 * Author: peterzhu2118 (Peter Zhu) * Status: Closed * Priority: Normal ---------------------------------------- Pull Request: https://github.com/ruby/ruby/pull/7304 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. -- https://bugs.ruby-lang.org/

Issue #19437 has been updated by mame (Yusuke Endoh). Just a curious question. Is compaction time classified as `marking_time` or `sweeping_time`? ---------------------------------------- Feature #19437: Add marking and sweeping time to GC.stat https://bugs.ruby-lang.org/issues/19437#change-102319 * Author: peterzhu2118 (Peter Zhu) * Status: Closed * Priority: Normal ---------------------------------------- Pull Request: https://github.com/ruby/ruby/pull/7304 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. -- https://bugs.ruby-lang.org/

Issue #19437 has been updated by ko1 (Koichi Sasada). Similar question with mame-san's #5, but at the last marking starts sweeping. does the current patch (already merged) split it? ---------------------------------------- Feature #19437: Add marking and sweeping time to GC.stat https://bugs.ruby-lang.org/issues/19437#change-102331 * Author: peterzhu2118 (Peter Zhu) * Status: Closed * Priority: Normal ---------------------------------------- Pull Request: https://github.com/ruby/ruby/pull/7304 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. -- https://bugs.ruby-lang.org/

Issue #19437 has been updated by peterzhu2118 (Peter Zhu).
Is compaction time classified as marking_time or sweeping_time?
It will be part of sweeping_time. I think it's not very accurate to have a compacting_time because we do sweeping during compaction, so I chose to put compaction time in sweeping_time. It might make sense to have compacting_time in the future, but since it's disabled by default and I'm not aware of any production services using auto-compaction in production (we only run `GC.compact` before forking here at Shopify), so we don't need this data right now.
does the current patch (already merged) split it?
I refactored the code so that the marking and sweeping phases are separated (in [d7c1ca4](https://github.com/ruby/ruby/commit/d7c1ca48bf7754a23bfe1559422736029b4787a0). ---------------------------------------- Feature #19437: Add marking and sweeping time to GC.stat https://bugs.ruby-lang.org/issues/19437#change-102363 * Author: peterzhu2118 (Peter Zhu) * Status: Closed * Priority: Normal ---------------------------------------- Pull Request: https://github.com/ruby/ruby/pull/7304 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. -- https://bugs.ruby-lang.org/
participants (6)
-
AMomchilov (Alexander Momchilov)
-
ko1 (Koichi Sasada)
-
mame (Yusuke Endoh)
-
peterzhu2118 (Peter Zhu)
-
peterzhu2118 (Peter Zhu)
-
rubyFeedback (robert heiler)