Skip to content

Avoid a source_span query when encoding Spans into query results #115657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Sep 8, 2023

This avoids a source_span query when encoding Spans into query results. It's not sound to execute queries here as the query caches can be locked and the dep graph is no longer writable.

r? @cjgillot

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 8, 2023
encode_query_cache(tcx, e)
});
});
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are blocks swapped?
Should this block be wrapped inside a dep_graph.with_query_deserialization to ICE if a query is invoked?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typeck and mir_borrowck still use queries in their cache_on_disk_if block, so that cannot be used yet. This block order can cause panics due to GraphEncoder being stolen though, so it will catch query execution at least.

@cjgillot
Copy link
Contributor

cjgillot commented Sep 9, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 9, 2023

📌 Commit 2a5121b has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 9, 2023
@bors
Copy link
Collaborator

bors commented Sep 9, 2023

⌛ Testing commit 2a5121b with merge 38bbc2c...

@bors
Copy link
Collaborator

bors commented Sep 9, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 38bbc2c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 9, 2023
@bors bors merged commit 38bbc2c into rust-lang:master Sep 9, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 9, 2023
@Zoxc Zoxc deleted the source-span-avoid-query branch September 9, 2023 11:07
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (38bbc2c): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.4% [0.3%, 0.4%] 2
Regressions ❌
(secondary)
0.7% [0.4%, 1.0%] 7
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 2
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.4%] 4
All ❌✅ (primary) -0.0% [-0.4%, 0.4%] 4

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.9% [1.8%, 2.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [-0.9%, 2.0%] 4

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 629.42s -> 628.91s (-0.08%)
Artifact size: 318.13 MiB -> 318.15 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Sep 9, 2023
@pnkfelix
Copy link
Member

  • primary regressions are to diesel-check (full and incr-full).
  • This is fixing a soundness issue with the dep-graph maintenance; therefore, these regressions seem tolerable.
  • Marking as triaged

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants