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

internal: Preserve resolve_obligations_as_possible temporary allocation across calls #15436

Merged
merged 1 commit into from Aug 12, 2023

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Aug 10, 2023

This saves ~20ms in the highlihting bench on my machine

  284ms - highlight
      150ms - infer:wait @ per_query_memory_usage
          150ms - infer_query
                0   - PerNs::filter_visibility (436 calls)
                0   - crate_def_map:wait (336 calls)
                2ms - deref_by_trait (909 calls)
                0   - generic_params_query (1 calls)
                0   - inherent_impls_in_block_query (1 calls)
              107ms - resolve_obligations_as_possible (17013 calls)
                0   - trait_solve::wait (1017 calls)
        0   - PerNs::filter_visibility (13 calls)
       17ms - Semantics::analyze_impl (19 calls)
        0   - SourceBinder::to_module_def (30 calls)
        0   - attrs_query (6 calls)
        0   - classify_lifetime (1 calls)
        0   - classify_lifetime_ref (4 calls)
       35ms - classify_name (28 calls)
       54ms - classify_name_ref (452 calls)
        0   - crate_def_map:wait (375 calls)
        7ms - descend_into_macros (776 calls)
        0   - generic_params_query (5 calls)
        0   - impl_data_with_diagnostics_query (1 calls)
       17ms - infer:wait (32 calls)
        0   - resolve_obligations_as_possible (1 calls)
        0   - source_file_to_def (1 calls)
        0   - trait_solve::wait (1 calls)

to


  256ms - highlight
      121ms - infer:wait @ per_query_memory_usage
          121ms - infer_query
                0   - PerNs::filter_visibility (436 calls)
                0   - crate_def_map:wait (336 calls)
                2ms - deref_by_trait (909 calls)
                0   - generic_params_query (1 calls)
                0   - inherent_impls_in_block_query (1 calls)
               81ms - resolve_obligations_as_possible (17013 calls)
                0   - trait_solve::wait (1017 calls)
        0   - PerNs::filter_visibility (13 calls)
       17ms - Semantics::analyze_impl (19 calls)
        0   - SourceBinder::to_module_def (30 calls)
        0   - attrs_query (6 calls)
        0   - classify_lifetime (1 calls)
        0   - classify_lifetime_ref (4 calls)
       35ms - classify_name (28 calls)
       56ms - classify_name_ref (452 calls)
        0   - crate_def_map:wait (375 calls)
        7ms - descend_into_macros (776 calls)
        0   - generic_params_query (5 calls)
        0   - impl_data_with_diagnostics_query (1 calls)
       16ms - infer:wait (32 calls)
        0   - resolve_obligations_as_possible (1 calls)
        0   - source_file_to_def (1 calls)
        0   - trait_solve::wait (1 calls)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2023
@lowr
Copy link
Contributor

lowr commented Aug 11, 2023

Seems reasonable, can you put a comment somewhere, maybe a doc comment on the field?

@Veykril
Copy link
Member Author

Veykril commented Aug 12, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 12, 2023

📌 Commit c1c8e78 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 12, 2023

⌛ Testing commit c1c8e78 with merge 39ebc37...

@bors
Copy link
Collaborator

bors commented Aug 12, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 39ebc37 to master...

@bors bors merged commit 39ebc37 into rust-lang:master Aug 12, 2023
10 checks passed
@lnicola lnicola changed the title Preserve resolve_obligations_as_possible temporary allocation across calls internal: Preserve resolve_obligations_as_possible temporary allocation across calls Aug 13, 2023
@Veykril Veykril deleted the temp-alloc branch August 14, 2023 13:26
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants