Skip to content

Fix hack that remaps env constness. #99521

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 2 commits into from
Jul 22, 2022

Conversation

fee1-dead
Copy link
Member

WARNING: might have perf implications.

Are there any more problems with having a constness in the ParamEnv now? :)

r? @oli-obk

WARNING: might have perf implications.

Are there any more problems with having a constness
in the `ParamEnv` now? :)
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 20, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 20, 2022
@fee1-dead
Copy link
Member Author

@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 Jul 21, 2022
@bors
Copy link
Collaborator

bors commented Jul 21, 2022

⌛ Trying commit 8464396 with merge c95b5ba98e182bab01bc996efe8503c2e0e5be8f...

@bors
Copy link
Collaborator

bors commented Jul 21, 2022

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

@rust-timer
Copy link
Collaborator

Queued c95b5ba98e182bab01bc996efe8503c2e0e5be8f with parent be9cfb3, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c95b5ba98e182bab01bc996efe8503c2e0e5be8f): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
0.5% 0.8% 6
Regressions 😿
(secondary)
0.6% 0.6% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 0.5% 0.8% 6

Max RSS (memory usage)

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
2.8% 2.8% 1
Regressions 😿
(secondary)
3.3% 4.6% 3
Improvements 🎉
(primary)
-3.5% -4.8% 2
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -1.4% -4.8% 3

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
5.0% 5.6% 6
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

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 may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 21, 2022
@fee1-dead
Copy link
Member Author

fee1-dead commented Jul 21, 2022

This might just be noise because the benchmarks related to the trait system that I expect could regress didn't (diesel and other benchmarks). Instead all regressions are on the doc mode. @oli-obk can you please double check my analysis and add the triaged label if you agree? Thanks.

Edit: I would also want to know if storing constness in the param env is okay.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 21, 2022

25,703,966  ???:<alloc::vec::Vec<rustc_infer::traits::Obligation<rustc_middle::ty::Predicate>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_infer::traits::Obligation<rustc_middle::ty::Predicate>, core::iter::adapters::map::Map<alloc::vec::into_iter::IntoIter<rustc_infer::traits::Obligation<rustc_middle::ty::Predicate>>, <rustc_trait_selection::traits::select::SelectionContext>::confirm_candidate::{closure
11,779,364  ???:<rustc_trait_selection::traits::select::SelectionContext>::confirm_candidate
 5,913,240  ???:<rustc_middle::ty::Predicate>::without_const
 2,288,209  ???:<rustc_parse::parser::Parser>::parse_path_segment
-2,022,396  ???:<rustc_parse::parser::Parser>::parse_path_start_expr
 1,812,188  ???:<rustc_span::hygiene::ExpnId as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
-1,680,053  ???:<rustc_span::hygiene::SyntaxContextData as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
   554,031  ???:<rustc_trait_selection::traits::select::SelectionContext>::select
   391,278  ???:<rustc_resolve::Resolver>::create_def
  -322,449  ???:<rustc_resolve::def_collector::DefCollector as rustc_ast::visit::Visitor>::visit_item
  -238,586  ???:<hashbrown::map::HashMap<rustc_middle::ty::sty::Binder<rustc_middle::ty::TraitPredicate>, (), core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>::insert
  -152,955  ???:<alloc::vec::Vec<rustc_infer::traits::Obligation<rustc_middle::ty::Predicate>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_infer::traits::Obligation<rustc_middle::ty::Predicate>, core::iter::adapters::flatten::FlatMap<core::slice::iter::Iter<rustc_middle::ty::Ty>, alloc::vec::Vec<rustc_infer::traits::Obligation<rustc_middle::ty::Predicate>>, <rustc_trait_selection::traits::select::SelectionContext>::collect_predicates_for_types::{closure
   136,401  /build/glibc-sMfBJT/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_sse2_unaligned_erms
  -118,541  ???:<rustc_parse::lexer::StringReader>::next_token
   109,170  ???:<hashbrown::map::HashMap<rustc_span::def_id::DefId, rustc_span::def_id::DefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>::insert
   108,683  ???:_rjem_je_eset_fit
  -106,850  ???:<rustc_middle::traits::specialization_graph::Graph as rustc_trait_selection::traits::specialize::specialization_graph::GraphExt>::insert
   101,581  ???:<rustc_middle::ty::context::CtxtInterners>::intern_predicate
    91,286  ???:rustc_ast::visit::walk_fn::<rustc_ast_passes::feature_gate::PostExpansionVisitor>
   -86,774  ???:_rjem_je_arena_cache_bin_fill_small
    82,536  ???:_rjem_je_tcache_bin_flush_small
   -75,189  ???:<rustc_middle::ty::context::TyCtxt>::intern_substs
   -56,736  ???:rustc_ast::visit::walk_assoc_item::<rustc_ast_passes::feature_gate::PostExpansionVisitor>
   -51,774  ???:<hashbrown::raw::RawTable<(rustc_middle::ty::sty::Binder<rustc_middle::ty::TraitPredicate>, ())>>::insert::<hashbrown::map::make_hasher<rustc_middle::ty::sty::Binder<rustc_middle::ty::TraitPredicate>, rustc_middle::ty::sty::Binder<rustc_middle::ty::TraitPredicate>, (), core::hash::BuildHasherDefault<rustc_hash::FxHasher>>::{closure
    49,484  ???:<rustc_middle::ty::flags::FlagComputation>::add_substs

a small rustdoc regression

@oli-obk
Copy link
Contributor

oli-obk commented Jul 21, 2022

This is probably due to rustdoc moving everything through the trait solver multiple times.
The other tiny regressions are just noise:

 72,337  ???:_rjem_je_edata_heap_remove_first
 60,510  ???:base_alloc_impl
 39,006  ???:(anonymous namespace)::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&)
-38,902  ???:(anonymous namespace)::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&) [clone 
 31,543  ???:std::pair<std::_Rb_tree_iterator<std::pair<llvm::MCContext::ELFEntrySizeKey const, unsigned int> >, bool> std::_Rb_tree<llvm::MCContext::ELFEntrySizeKey, std::pair<llvm::MCContext::ELFEntrySizeKey const, unsigned int>, std::_Select1st<std::pair<llvm::MCContext::ELFEntrySizeKey const, unsigned int> >, std::less<llvm::MCContext::ELFEntrySizeKey>, std::allocator<std::pair<llvm::MCContext::ELFEntrySizeKey const, unsigned int> > >::_M_emplace_unique<std::pair<llvm::MCContext::ELFEntrySizeKey, unsigned int> >(std::pair<llvm::MCContext::ELFEntrySizeKey, unsigned int>&&)
-24,616  ???:std::_Rb_tree<llvm::MCContext::ELFEntrySizeKey, std::pair<llvm::MCContext::ELFEntrySizeKey const, unsigned int>, std::_Select1st<std::pair<llvm::MCContext::ELFEntrySizeKey const, unsigned int> >, std::less<llvm::MCContext::ELFEntrySizeKey>, std::allocator<std::pair<llvm::MCContext::ELFEntrySizeKey const, unsigned int> > >::_M_get_insert_unique_pos(llvm::MCContext::ELFEntrySizeKey const&)
-18,557  /build/glibc-sMfBJT/glibc-2.31/string/../sysdeps/x86_64/strcmp.S:strcmp
-15,609  ???:_rjem_je_edata_avail_remove
 10,736  /build/glibc-sMfBJT/glibc-2.31/elf/dl-lookup.c:_dl_lookup_symbol_x
 10,454  ???:llvm::FPPassManager::runOnFunction(llvm::Function&)

@oli-obk
Copy link
Contributor

oli-obk commented Jul 21, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 21, 2022

📌 Commit a0ebb2e has been approved by oli-obk

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 Jul 21, 2022
@bors
Copy link
Collaborator

bors commented Jul 22, 2022

⌛ Testing commit a0ebb2e with merge 22d25f2...

@bors
Copy link
Collaborator

bors commented Jul 22, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 22d25f2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 22, 2022
@bors bors merged commit 22d25f2 into rust-lang:master Jul 22, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 22, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (22d25f2): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
0.5% 0.8% 7
Regressions 😿
(secondary)
0.6% 0.6% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 0.5% 0.8% 7

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.6% -2.6% 2
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
1.7% 1.7% 1
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-4.8% -7.5% 2
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -2.6% -7.5% 3

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

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

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@pnkfelix
Copy link
Member

  • This regression was anticipated by the PR author and analyzed by the reviewer.
  • marking as triaged.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jul 27, 2022
@fee1-dead fee1-dead deleted the const_fix_hax branch July 27, 2022 17:32
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.

8 participants