Skip to content

Add triagebot benchmark #2145

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

Closed
wants to merge 3 commits into from
Closed

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented May 29, 2025

Opening as a draft, as an example of a real-world async application.

@nnethercote
Copy link
Contributor

I profiled this. It looked very normal except for one unusual entry:

39,468,484 (1.8%, 19.3%) <rustc_mir_transform::coroutine::StorageConflictVisitor>::apply_state:

The await-call-tree benchmark has 0.7% in that function, and deeply-nested-multi has 0.2%. So there's a quirk, but I don't know if it's enough to justify adding it. We might have spare capacity now, I'd be inclined to keep that available for the inevitable future cases where we want to add a new benchmark for a more compelling reason.

@Kobzol
Copy link
Member Author

Kobzol commented Jul 4, 2025

The original idea was to add a non-trivial real-world app that heavily uses async, because we don't have any of these. But if you think it's uninteresting, we can probably skip it for now, yeah, because it takes a long time to prepare with its 300+ dependencies.

FWIW, I tried to switch the config from --bin triagebot to --lib, which takes ~10x more instructions. Here is the profile for check IncrPatched:

< 5,348,412,874 (95.4%, 95.4%)  ???:
    496,266,269  (8.8%)           <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
    144,045,132  (2.6%)           <rustc_stable_hash::sip128::SipHasher128>::short_write_process_buffer::<8>
    137,669,143  (2.5%)           <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_span::SpanEncoder>::encode_span
    132,206,627  (2.4%)           <rustc_query_impl::query_impl::typeck::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 8]>)>>::call_once
    124,375,527  (2.2%)           <rustc_middle::query::on_disk_cache::CacheDecoder as rustc_span::SpanDecoder>::decode_span
    110,497,916  (2.0%)           rustc_incremental::persist::load::setup_dep_graph
    103,635,966  (1.8%)           <rustc_span::span_encoding::Span as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
    103,630,327  (1.8%)           <rustc_proc_macro::bridge::server::Dispatcher<rustc_proc_macro::bridge::server::MarkedTypes<rustc_expand::proc_macro_server::Rustc>> as rustc_proc_macro::bridge::server::DispatcherTrait>::dispatch::{closure#13}
     97,434,616  (1.7%)           <rustc_expand::expand::MacroExpander>::fully_expand_fragment
     91,450,785  (1.6%)           free
     85,224,623  (1.5%)           <rustc_ast_lowering::LoweringContext>::lower_qpath
     84,937,276  (1.5%)           <rustc_span::caching_source_map_view::CachingSourceMapView>::span_data_to_lines_and_cols
     75,600,639  (1.3%)           <rustc_resolve::Resolver>::resolve_path_with_ribs
     71,119,655  (1.3%)           <rustc_parse::parser::Parser>::collect_tokens_for_expr::<<rustc_parse::parser::Parser>::parse_expr_dot_or_call::{closure#0}>
     66,581,947  (1.2%)           <rustc_resolve::Resolver>::resolve_ident_in_module_unadjusted
     64,817,798  (1.2%)           tcache_bin_flush_small
     64,318,570  (1.1%)           malloc
     63,376,544  (1.1%)           <rustc_middle::ty::Ty as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
     55,327,378  (1.0%)           <rustc_middle::mir::Body as rustc_serialize::serialize::Encodable<rustc_metadata::rmeta::encoder::EncodeContext>>::encode
     54,716,613  (1.0%)           <rustc_span::span_encoding::Span>::to
     53,332,365  (1.0%)           rustc_middle::ty::codec::encode_with_shorthand::<rustc_middle::query::on_disk_cache::CacheEncoder, rustc_middle::ty::Ty, <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_middle::ty::codec::TyEncoder>::type_shorthands>
     52,091,618  (0.9%)           <rustc_resolve::Resolver>::traits_in_scope
     51,694,108  (0.9%)           <rustc_hir::hir::QPath as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
     45,192,007  (0.8%)           <rustc_middle::query::on_disk_cache::CacheDecoder as rustc_span::SpanDecoder>::decode_def_id
     44,025,512  (0.8%)           realloc

and IncrFull:

< 27,624,085,810 (97.3%, 97.3%)  ???:
     775,798,788  (2.7%)           <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
     761,869,296  (2.7%)           <rustc_trait_selection::traits::select::SelectionContext>::assemble_candidates
     674,274,102  (2.4%)           free
     646,617,099  (2.3%)           <rustc_middle::ty::context::CtxtInterners>::intern_ty
     542,802,739  (1.9%)           <rustc_mir_transform::coroutine::StorageConflictVisitor>::apply_state
     534,130,079  (1.9%)           <rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation::{closure#0}
     533,314,789  (1.9%)           <rustc_middle::dep_graph::DepsType as rustc_query_system::dep_graph::Deps>::read_deps::<<rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::DepsType>>::read_index::{closure#0}>
     503,918,275  (1.8%)           rustc_borrowck::do_mir_borrowck
     453,935,669  (1.6%)           <rustc_middle::ty::context::CtxtInterners>::intern_predicate
     453,674,907  (1.6%)           malloc
     429,751,893  (1.5%)           rustc_borrowck::get_flow_results
     418,653,542  (1.5%)           <rustc_trait_selection::traits::select::SelectionContext>::confirm_auto_impl_candidate::{closure#0}
     393,338,741  (1.4%)           <rustc_query_impl::query_impl::typeck::dynamic_query::{closure#7} as core::ops::function::FnOnce<(&mut rustc_query_system::ich::hcx::StableHashingContext, &rustc_middle::query::erase::Erased<[u8; 8]>)>>::call_once
     364,469,001  (1.3%)           <rustc_trait_selection::traits::select::SelectionContext>::confirm_candidate
     358,684,558  (1.3%)           <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
     357,947,832  (1.3%)           <rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate::{closure#0}::{closure#0}
     329,447,734  (1.2%)           <rustc_stable_hash::sip128::SipHasher128>::short_write_process_buffer::<8>
     276,885,916  (1.0%)           <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
     267,432,009  (0.9%)           rustc_mir_transform::simplify::simplify_cfg
     259,497,217  (0.9%)           <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
     258,082,972  (0.9%)           <rustc_type_ir::binder::ArgFolder<rustc_middle::ty::context::TyCtxt> as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
     256,066,918  (0.9%)           tcache_bin_flush_small
     243,185,517  (0.9%)           realloc
     225,742,399  (0.8%)           <rustc_middle::mir::BasicBlockData as rustc_data_structures::stable_hasher::HashStable<rustc_query_system::ich::hcx::StableHashingContext>>::hash_stable
     220,699,829  (0.8%)           <rustc_trait_selection::traits::select::SelectionContext>::poly_select::{closure#0}

If you don't see anything interesting there, I'll close this.

@nnethercote
Copy link
Contributor

I did a local run with the library, again, it looks similar to before and not that distinctive.

@Kobzol
Copy link
Member Author

Kobzol commented Jul 4, 2025

Ok. Thanks for taking a look!

@Kobzol Kobzol closed this Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants