Skip to content
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

Allocate one vec, instead of one per invocation #93007

Closed
wants to merge 1 commit into from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 17, 2022

potential alternative to #92928

r? @ghost

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 17, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 17, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 17, 2022
@bors
Copy link
Contributor

bors commented Jan 17, 2022

⌛ Trying commit d57fdcf with merge 38a6fb92aa4547ce389f02f56fb7135dd5b17ae9...

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/compiler/rustc_infer/src/infer/canonical/query_response.rs at line 219:
         original_values: &OriginalQueryValues<'tcx>,
         query_response: &Canonical<'tcx, QueryResponse<'tcx, R>>,
         output_query_region_constraints: &mut QueryRegionConstraints<'tcx>,
-        obligations: &mut PredicateObligations<'tcx>
+        obligations: &mut PredicateObligations<'tcx>,
     ) -> Result<R, TypeError<'tcx>>
     where
         R: Debug + TypeFoldable<'tcx>,
Diff in /checkout/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs at line 1:
 use crate::infer::canonical::{
     Canonicalized, CanonicalizedQueryResponse, OriginalQueryValues, QueryRegionConstraints,
 };
-use crate::infer::{InferCtxt};
+use crate::infer::InferCtxt;
 use crate::traits::query::Fallible;
 use crate::traits::ObligationCause;
 use rustc_infer::infer::canonical::{Canonical, Certainty};
Diff in /checkout/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs at line 82:
         infcx: &InferCtxt<'_, 'tcx>,
         output_query_region_constraints: &mut QueryRegionConstraints<'tcx>,
         obligations: &mut PredicateObligations<'tcx>,
-    ) -> Fallible<(
-        Self::QueryResponse,
-        Option<Canonical<'tcx, ParamEnvAnd<'tcx, Self>>>,
-        Certainty,
-    )> {
+    ) -> Fallible<(Self::QueryResponse, Option<Canonical<'tcx, ParamEnvAnd<'tcx, Self>>>, Certainty)>
+    {
         if let Some(result) = QueryTypeOp::try_fast_path(infcx.tcx, &query_key) {
             return Ok((result, None, Certainty::Proven));
         }
Diff in /checkout/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs at line 101:
             infcx.canonicalize_query_keep_static(query_key, &mut canonical_var_values);
         let canonical_result = Self::perform_query(infcx.tcx, canonical_self)?;
-        let value = infcx
-        let value = infcx
-            .instantiate_nll_query_response_and_region_obligations(
-                &ObligationCause::dummy(),
-                old_param_env,
-                &canonical_var_values,
-                canonical_result,
-                output_query_region_constraints,
-                obligations,
-            )?;
+        let value = infcx.instantiate_nll_query_response_and_region_obligations(
+            &ObligationCause::dummy(),
+            old_param_env,
+            &canonical_var_values,
+            canonical_result,
+            output_query_region_constraints,
+            obligations,
+        )?;
 
         Ok((value, Some(canonical_self), canonical_result.value.certainty))
Build completed unsuccessfully in 0:00:13
Build completed unsuccessfully in 0:00:13
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/different_lifetimes.rs" "/checkout/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/placeholder_error.rs" "/checkout/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/util.rs" "/checkout/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs" "/checkout/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs" "/checkout/compiler/rustc_infer/src/infer/error_reporting/note.rs" "/checkout/compiler/rustc_infer/src/infer/canonical/query_response.rs" "/checkout/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/mod.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.

@bors
Copy link
Contributor

bors commented Jan 17, 2022

☀️ Try build successful - checks-actions
Build commit: 38a6fb92aa4547ce389f02f56fb7135dd5b17ae9 (38a6fb92aa4547ce389f02f56fb7135dd5b17ae9)

@rust-timer
Copy link
Collaborator

Queued 38a6fb92aa4547ce389f02f56fb7135dd5b17ae9 with parent a34c079, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (38a6fb92aa4547ce389f02f56fb7135dd5b17ae9): comparison url.

Summary: This change led to moderate relevant improvements 🎉 in compiler performance.

  • Moderate improvement in instruction counts (up to -0.8% on incr-unchanged builds of externs debug)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 17, 2022
@oli-obk oli-obk closed this Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants