Repository navigation
perf(rust): the fresh runtime is made once per process and copied by each run - #85
Merged
Merged
Conversation
hearnadam
force-pushed
the
perf/stack-02-image
branch
from
November 26, 2026 17:20
1740de9 to
97d4afe
Compare
…each run A run built about 290 built-in objects, 380 strings and 250 names from scratch, whatever its program: 352k instructions, most of what a short program cost. builtins::image() makes them once. Every compile starts from its strings (Strings::fresh), so they have the same ids in every run, and Vm::new copies its heap instead of running setup. A VM whose strings did not start from the image is still set up from scratch, as the image is. Also sizes a fresh run's arenas for what it makes (286 objects, not room for 1,024), and has the compiler note whether the program names 'constructor', which the string table no longer says. examples/corpus: 15.88M to 11.91M instructions; setup 352k to 100k. return 1: 360k to 111k. Idle waiting run: 154.7 to 84.5 KB.
… refused instead of misread Program strings now come after the image's (Strings::fresh), so a state from an earlier build can decode a string id as a different string while its build id still matches. The format bump changes the build id too.
kommander
force-pushed
the
perf/stack-02-image
branch
from
November 26, 2026 22:43
97d4afe to
ead0b94
Compare
kommander
added a commit
that referenced
this pull request
Nov 27, 2026
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 run built about 290 built-in objects, 380 strings and 250 names from scratch,
whatever its program: 352k instructions, most of what a short program cost.
builtins::image() makes them once. Every compile starts from its strings
(Strings::fresh), so they have the same ids in every run, and Vm::new copies
its heap instead of running setup. A VM whose strings did not start from the
image is still set up from scratch, as the image is.
Also sizes a fresh run's arenas for what it makes (286 objects, not room for
1,024), and has the compiler note whether the program names 'constructor',
which the string table no longer says.
examples/corpus: 15.88M to 11.91M instructions; setup 352k to 100k.
return 1: 360k to 111k. Idle waiting run: 154.7 to 84.5 KB.
Part 2 of 11 in a stack; based on
perf/stack-01-bench. 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).