Repository navigation
perf(repl): let a submission's parse trees go before its analysis - #1741
Merged
Merged
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…ll its references Co-Authored-By: jason.han <hanhuijun@gmail.com>
… rounds that pull references Co-Authored-By: jason.han <hanhuijun@gmail.com>
…k requires Co-Authored-By: jason.han <hanhuijun@gmail.com>
4 of 6 tasks
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.
What and why
Since #1441 a submission's parse trees (
[]parsed, one parser and tree per file) were passed on pastsubmissionResulttoresolveReferences/pullReferences, so they stayed referenced through the analysis of every load, for the root namespaces an unresolved reference would be looked up by. Before #1441 they died onceacceptParsedhad read them. The 0.12.0 gate measured the cost as the +31 MiB peak resident set ofsysml -validateon the 12 086-element generated model against 0.11.0, and bisected it to #1441 by the heap held at exit (56 → 74.5 MB).resolveReferencesandpullReferencesnow take the submission's[]SourceFileand parse again (parseRoots) only when the analysis left a subject unresolved — the rare case pays a second parse; the common case holds no trees through the analysis.workspaceLoad.parsesbecomessources. The lazy walk of #1624 is kept: a submission that resolves parses nothing twice and walks nothing (TestResolvingNothingDoesNotWalkTheText, adapted to pass sources).Fragment:
changes/unreleased/release-preparse-trees.fixed.md.How it was verified
Memory acceptance,
bin/sysml -validatebuilt asmake buildbuilds it (CGO_ENABLED=0 -ldflags "-s -w",go1.27.3for every column), one warm-up run per binary and model, then three cold runs per configuration, interleaved; medians, peak RSS in MiB (the three runs in brackets). Columns: 0.11.0 source · the merge before #1441 (511061d46) · #1441 (c082e554c) ·develop(1c6bb1972) · this branch.GOGC=100GOGC=25GOGC=25GOGC=25GOMEMLIMIT=120MiB, generated 12 086ulimit -v 1200000, generated 12 086GOGC=25keeps the resident set near the live heap and is the row that separates the configurations; atGOGC=100the collector's pacing spreads single runs by ±10 MiB (develop's 194). Under the memory limit the candidate spends 0.44 s to 0.11.0's 0.28 s and this branch 0.25 s. Underulimit -v 600000every binary, 0.11.0 included, fails at start from the runtime's address-space reservation, so 1.2 GB is the cap used.Six rounds,
benchstat, same four revisions, the load rows (bytes and allocations unchanged by this branch, as expected — the trees were garbage either way; what moves is when):(The +5 % B/op of develop over pre-#1441 on every load row is #1478, addressed in its own PR; the
LoadModel/0allocations are #1462, likewise.)Definition of done on this branch:
The two corpus gates failed only because the measurement VM set the require variables without holding those corpora; fetched, both pass. Nothing in this branch touches identity or migration.
Checklist
make testandmake lintpass locally —go build ./...,go vet ./...,gofmt -l .empty,go test ./...aboveTestResolvingNothingDoesNotWalkTheTextnow drives the sources pathchanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved — no gate count movedF4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/15408827f8104c7fbbdbd1b2c852ed2c
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/15408827f8104c7fbbdbd1b2c852ed2c?variant=devin
Requested by: @HuiJun