mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Recently we added some keys to GC.stat in order to measure the GC performance of Ractor local GC and the associated global GC. This commit refactors some of those terms: "global" was used in two places with different meanings which could get confusing. When it was passed to GC.stat as scope: :global it meant "Give me aggregate stats for all the GCs running in this process". Whereas inside the output of GC.stat, global referred to the number of "global" GCs that are run. That is: stop-the-world GCs that run on every ractor heap in the process. Also the global_gc_count that GC.stat reports for a Ractor ignored global GCs that other Ractors started, even though they swept its heap. In this commit we fix this confusing behaviour, and make the GC.stat output more consistent. We've replaced the scope: parameter to GC.stat with the boolean process: keyword arg. The default is process: false which means GC.stat will return stats for the Ractor that executes the code (the main Ractor if no other Ractors have been created). process: true will return aggregate stats over all the Ractors in the process (including dead ones). Inside GC.stat(process: false), count and global_gc_count now include every global GC that has swept that Ractor's heap. So Ractor local gc count == count - global_gc_count. heap_marked_slots now counts only the marked objects in that Ractor's own heap. Before, the Ractor that started a global GC counted the marked objects of every heap, and the other Ractors reported 0. We also provide a new key global_gc_invocation_count that is the number of global GCs that have been triggered by the Ractor in question. We've also moved some keys related to the global page pool out of the default GC.stat output and into GC.stat(process: true), because they are process-wide and not Ractor specific.
README this file biorhythm.rb biorhythm calculator cal.rb cal(1) clone cbreak.rb no echo done by ioctl clnt.rb socket client coverage.rb simple test code coverage tool dir.rb directory access dualstack-fetch.rb IPv6 demo dualstack-httpd.rb IPv6 demo eval.rb simple evaluator export.rb method access example exyacc.rb extrace BNF from yacc file fact.rb factorial calculator fib.awk Fibonacci number (AWK) fib.pl Fibonacci number (Perl) fib.py Fibonacci number (Python) fib.rb Fibonacci number (Ruby) fib.scm Fibonacci number (Scheme) from.rb scan mail spool fullpath.rb convert ls -lR to fullpath format less.rb front end for less list.rb stupid object sample list2.rb stupid object sample list3.rb stupid object sample mine.rb simple mine sweeper mkproto.rb extract prototype from C mpart.rb split file int multi part observ.rb observer design pattern sample occur.pl count word occurrence (Perl) occur.rb count word occurrence (Ruby) philos.rb famous dining philosophers pi.rb calculate PI rcs.awk random character stereogram (AWK) rcs.rb random character stereogram (Ruby) rcs.dat data for random character stereogram sieve.rb sieve of Eratosthenes svr.rb socket server test.rb test suite used by `make test' time.rb /usr/bin/time clone timeout.rb timeout test trojan.rb simple tool to find file that may be trojan horse. tsvr.rb socket server using thread uumerge.rb merge files and uudecode them