Skip to content

Don't query stability data when staged_api is off #76656

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 14, 2020
Merged

Don't query stability data when staged_api is off #76656

merged 1 commit into from
Sep 14, 2020

Conversation

jonas-schievink
Copy link
Contributor

This data only needs to be encoded when #![feature(staged_api)] or -Zforce-unstable-if-unmarked is on. Running these queries takes measurable time on large crates with many items, so skip it when the unstable flags have not been enabled.

@rust-highfive
Copy link
Contributor

r? @lcnr

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 13, 2020
@jonas-schievink
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Collaborator

bors commented Sep 13, 2020

⌛ Trying commit a447c21 with merge 2bc97edb7f7a2845b0c5942bc0a2ab9fc969cece...


// The query lookup can take a measurable amount of time in crates with many items. Check if
// the stability attributes are even enabled before using their queries.
if self.feat.staged_api || self.tcx.sess.opts.debugging_opts.force_unstable_if_unmarked {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should optimize force_unstable_if_unmarked - we know the result of the query ahead of time if staged API is false, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that flag used anywhere outside building libstd?

Copy link
Member

Choose a reason for hiding this comment

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

No (well, rustc too), but speeding up compiler development if possible seems good.

@bors
Copy link
Collaborator

bors commented Sep 13, 2020

☀️ Try build successful - checks-actions, checks-azure
Build commit: 2bc97edb7f7a2845b0c5942bc0a2ab9fc969cece (2bc97edb7f7a2845b0c5942bc0a2ab9fc969cece)

@rust-timer
Copy link
Collaborator

Queued 2bc97edb7f7a2845b0c5942bc0a2ab9fc969cece with parent dbb73f8, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (2bc97edb7f7a2845b0c5942bc0a2ab9fc969cece): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never

@jyn514 jyn514 added A-stability Area: `#[stable]`, `#[unstable]` etc. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 13, 2020
@lcnr
Copy link
Contributor

lcnr commented Sep 13, 2020

This looks good to me 👍

@jonas-schievink do you want to implement the review by @Mark-Simulacrum in this PR?

Otherwise r=me

@jonas-schievink
Copy link
Contributor Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Sep 13, 2020

📌 Commit a447c21 has been approved by lcnr

@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 13, 2020
@bors
Copy link
Collaborator

bors commented Sep 13, 2020

⌛ Testing commit a447c21 with merge 2425de123523e1d5b68e8944d5891546ea8a82b1...

@bors
Copy link
Collaborator

bors commented Sep 13, 2020

💥 Test timed out

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

@bors retry

@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 13, 2020
@bors
Copy link
Collaborator

bors commented Sep 14, 2020

⌛ Testing commit a447c21 with merge 1eb00ab...

@bors
Copy link
Collaborator

bors commented Sep 14, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: lcnr
Pushing 1eb00ab to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 14, 2020
@bors bors merged commit 1eb00ab into rust-lang:master Sep 14, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 14, 2020
@ecstatic-morse
Copy link
Contributor

Hi! This PR showed up in the weekly perf triage report. It resulted in a moderate improvement in instruction counts (up to -1.5% on incr-unchanged builds of many-assoc-items-check).

A small win, as expected. Nice work!

@jonas-schievink jonas-schievink deleted the fewer-unstable-metadata-queries branch September 21, 2020 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stability Area: `#[stable]`, `#[unstable]` etc. I-compiletime Issue: Problems and improvements with respect to compile times. merged-by-bors This PR was explicitly merged by bors. 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.

9 participants