perf(graph): do not rebuild TestFileFilter when the session already has one - #836
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-6-reuse-prepared-testfilefilter-during-graph-config
branch
from
September 5, 2026 07:06
359385f to
50f8de2
Compare
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-6-reuse-prepared-testfilefilter-during-graph-config
branch
from
September 5, 2026 07:40
4dcd916 to
ddc0f29
Compare
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-6-reuse-prepared-testfilefilter-during-graph-config
branch
from
September 5, 2026 07:47
ddc0f29 to
4a81884
Compare
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-6-reuse-prepared-testfilefilter-during-graph-config
branch
from
September 5, 2026 07:51
4a81884 to
a6314e9
Compare
…as one Thread prepared project filters into graph config load so a session does not compile test globs a second time.
Add multi-root and unprepared-fallback call-count tests; trim comments.
rust-max-lines-per-file capped builder.rs and graph_gates.rs at 200 code lines after the session TestFileFilter path was added.
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-6-reuse-prepared-testfilefilter-during-graph-config
branch
from
September 5, 2026 07:56
a6314e9 to
4ddb5c0
Compare
jonathanong
marked this pull request as ready for review
September 5, 2026 07:56
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
builder_session.rs was split out for the line-limit gate and was missing from the files_config tests, so Codecov patch coverage of the session builder stayed below the 99% target.
This comment has been minimized.
This comment has been minimized.
jonathanong
deleted the
execute-plan/79dd0742-pr-6-reuse-prepared-testfilefilter-during-graph-config
branch
September 5, 2026 09:18
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.
Summary
An
AnalysisSessionowns oneTestFileFilterper root. Graph config reuses it instead of callingTestFileFilter::new→project_filtersagain. StandaloneDepGraph::build_with_plan_and_configstill uses the unprepared fallback (session=None).Call-count tests (not value equality) lock: seeded session does not increment
test_filter.builds/project_filters; unseeded session builds once; two roots do not share a cell;session=Nonestill compiles project filters without a session build.New bench group
graph_gates_build_session(does not change the existinggraph_gates_buildidentity).Local Criterion (source of truth)
Machine: macOS aarch64, rustc 1.96.0,
--sample-size 20. Same machine before/after. CodSpeed is not used as a gate.Unprepared
graph_gates_buildstill compiles test globs once per build (path unchanged; movement is noise):graph_gates_build/1graph_gates_build/4Prepared session path vs unprepared before on the same machine:
graph_gates_build_session/1graph_gates_build_session/4[4])Shepherd Journal
IC_kwDOSaSRXM8AAAABStTVkA/IC_kwDOSaSRXM8AAAABStTW5Aand Sourcery budget reviewPRR_kwDOSaSRXM8AAAABMTLc_Aare bot-limit notices; minimize only.PRRT_kwDOSaSRXM6fhdbC: AnalysisSession is request-scoped with one effective config (see the method comment and prepared-analysis ownership). A different config_path is a new request/session. Keying the OnceLock by root matches visible-path cells; hashing config identity on every graph-gates lookup would undo the reuse this PR measures. codecov patch/project lag is still upload/inProgress, not a missing TestFileFilter unit.builder_session.rs. Addedfiles_config_session_builder_reuses_prepared_test_filterso the session DepGraph builder path is executed twice and reuses the prepared TestFileFilter.IC_kwDOSaSRXM8AAAABStc8SQis a bot-limit notice; minimize only.curl: (35) Recv failure: Connection reset by peer) — transient infra, not graph-gates session code. codecov/patch/rust rose from 55.47% to 82.48% after the session builder test; remaining gap is likely uninstrumented benches/graph_gates_session.rs. Attempted rerun of 33955328154.