Repository navigation
perf(rust): a run collects while it waits for the host - #89
Merged
Merged
Conversation
hearnadam
force-pushed
the
perf/stack-06-gc-while-waiting
branch
from
November 26, 2026 17:20
a15076d to
465067d
Compare
kommander
force-pushed
the
perf/stack-06-gc-while-waiting
branch
3 times, most recently
from
November 26, 2026 22:50
8a183ed to
4a46576
Compare
A long-lived run kept up to 64k slots of garbage between cycles, most of what a small one held. The threshold while computing stays 64k slots, so a short program still never collects. A run that stops to wait for the host collects there, a whole cycle, once it has made 8k slots since its last one (Vm::gc_idle): time the program was not going to use. A heap over 256k slots keeps collecting in steps. examples/gc_bench, 20,000 events: palette loop peak live memory 16.1 to 1.9 MB; 50 runs with 5 active 51.7 to 13.2 MB; collection time and event latency unchanged.
kommander
force-pushed
the
perf/stack-06-gc-while-waiting
branch
from
November 26, 2026 22:52
4a46576 to
b030497
Compare
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.
A long-lived run kept up to 64k slots of garbage between cycles, most of what a
small one held. The threshold while computing stays 64k slots, so a short
program still never collects. A run that stops to wait for the host collects
there, a whole cycle, once it has made 8k slots since its last one
(Vm::gc_idle): time the program was not going to use. A heap over 256k slots
keeps collecting in steps.
examples/gc_bench, 20,000 events: palette loop peak live memory 16.1 to 1.9
MB; 50 runs with 5 active 51.7 to 13.2 MB; collection time and event latency
unchanged.
Part 6 of 11 in a stack; based on
perf/stack-05-shared-builtins. Each part was built, linted and tested on its own (cargo test --release --workspace, the same underPSYCHOSCRIPT_GC_STRESS=1, and the conformance cases underPSYCHOSCRIPT_ROUNDTRIP=1). Numbers are instructions retired, fromrust/bench/examples/corpusandmem_probe(part 1).