Repository navigation
Add multi-Ractor memory benchmarks - #538
Open
eightbitraptor wants to merge 4 commits into
Open
eightbitraptor wants to merge 4 commits into
eightbitraptor wants to merge 4 commits into
Conversation
Collaborator
|
I think we should look into using the |
luke-gruber
requested changes
Oct 2, 2026
luke-gruber
left a comment
Collaborator
There was a problem hiding this comment.
Let's merge --ractor-gc first and then try to use that for these benchmarks.
eightbitraptor
force-pushed
the
mvh-gc-ractor-benchmarks
branch
2 times, most recently
from
October 6, 2026 16:34
96776f1 to
929e233
Compare
eightbitraptor
marked this pull request as ready for review
October 7, 2026 08:48
These belong with the rest of the Ractor GC sampling helpers.
The ractor harness runs the benchmark block inside every Ractor it spawns. That doesn't work for benchmarks that need to coordinate their own Ractors from the main Ractor, for example to send them messages, or to keep them alive while we measure memory. With run_benchmark(n, scenario: true) the harness calls the block once per trial on the main Ractor with the Ractor count, and the block spawns its own Ractors. If the block returns a proc, the harness calls it after the memory measurement so idle Ractors can be cleaned up. Scenario mode doesn't run count 0 or a warmup. Each trial records the time, the RSS retained after a full GC compared to a baseline taken before the first trial, and the peak RSS while the block ran. We use GC.start(global: true) when it's available, because otherwise only the main Ractor is collected on Ractor-local GC builds. The harness can't tell which Ractors are the workers, so with --ractor-gc each worker wraps its body in measure_worker_gc and the main Ractor passes the samples to record_worker_gc.
These use the scenario mode to measure how much memory we fail to reclaim when multiple Ractors are involved. - ractor-dead-set: each Ractor builds a large live set and exits. - ractor-idle-garbage: each Ractor builds a large set, drops it and then sits idle, so nothing sweeps it. - ractor-msg-backlog: the main Ractor floods sleeping consumers with unshareable messages, so every consumer holds its own copy.
With Ractor GC data, the comparison GC summary was over 250 characters wide. This commit splits it into a GC time ratios table and a GC counts table. The "ratio" and "worker sum" labels move out of the column headers and into the table titles. Columns with no data in any row are hidden and listed under the table. global/iter is now shown as a count instead of a ratio. It's a GC count, and the legend says the ratios are GC time.
eightbitraptor
force-pushed
the
mvh-gc-ractor-benchmarks
branch
from
October 7, 2026 11:51
929e233 to
085ad51
Compare
Member
Author
|
This PR now uses the |
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.
Add three benchmarks that expose pathological memory behaviour with
multiple ractors.
ractor-dead-set: every ractor builds a large live set and terminates;
their final live sets cannot be reclaimed by a full GC.
ractor-idle-garbage: every ractor builds and drops a large set, then
idles without allocating; the garbage cannot be swept while they idle.
ractor-msg-backlog: unshareable payloads flood the queues of gated
consumer ractors, duplicating data per consumer.
benchmarks.yml marks them ractor_only with default_harness
harness-ractor-mem, which overrides the --category ractor default.