Skip to content

Recent 12% perf regression in unused-warnings #52092

Closed as not planned
Closed as not planned

Description

@alexcrichton

A recent perf regression showed up somewhere in this range. I don't think perf has enough data to narrow it down further yet to a particular PR, but of the PRs in that list #51895 looks the most suspect.

@nikomatsakis or @tmandry y'all may be interested in this!

Activity

  1. added
    I-compiletimeIssue: Problems and improvements with respect to compile times.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jul 6, 2018
  2. changed the title [-]Recent 8% perf regression in unused-warnings[/-] [+]Recent 12% perf regression in unused-warnings[/+] on Jul 6, 2018
  3. alexcrichton commented on Jul 6, 2018

    @alexcrichton
    MemberAuthor

    The wall time measurements look a bit more severe :(

    also cc @nnethercote

  4. nnethercote commented on Jul 9, 2018

    @nnethercote
    Contributor

    perf.rust-lang.org now clearly points to PR #51895:
    a739c51...8dd715e

  5. pnkfelix commented on Jul 12, 2018

    @pnkfelix
    Contributor

    visiting for triage. Assigning to @nikomatsakis for now, under assumption that he is best person to investigate this in the very short term.

  6. pnkfelix commented on Jul 12, 2018

    @pnkfelix
    Contributor

    also making P-high for now. (I'm not 100% clear on how important the efficiency of this particular benchmark is, but it is probably worth treating it as high until someone can provide an argument for deprioritization.)

  7. nikomatsakis commented on Jul 17, 2018

    @nikomatsakis
    Contributor

    I can investigate, but I'm not all that worried about this particular benchmark. It'd be good to do a quick profile though. I can't really imagine how this would make things slower apart from the fact that I did add a bit of data to metadata -- so maybe it's just the extra encoding costs?

  8. nikomatsakis commented on Jul 26, 2018

    @nikomatsakis
    Contributor

    I've not done any investigation this week. I lost access to my linux machine I use for profiling, so it will have to wait until 2 weeks from now when I'm back home. (Unless someone else wants to take a look.)

  9. self-assigned this
    on Jul 26, 2018
  10. pnkfelix commented on Jul 26, 2018

    @pnkfelix
    Contributor

    visiting for triage, assigning to self in hopes I find time to look at this during next week.

  11. 3 remaining items

  12. arielb1 commented on Aug 26, 2018

    @arielb1
    Contributor

    The relevant test file mainly consists of 20,000 use statements without any content.

    I had looked at this, and it is at least 90% accountable to the addition of 2*20,000 query calls during the processing:

    1. The new predicates_defined_on query: https://github.com/rust-lang/rust/pull/51895/files#diff-4ed25c00aceb84666fca639cf8101c7cR1313
    2. explicit_predicates_of at https://github.com/rust-lang/rust/pull/51895/files#diff-4ed25c00aceb84666fca639cf8101c7cR1316 being changed from a function call to a query

    This does feel like an edge-case to me - in most cases I can think of, the query overhead of actually collecting an item - which is just a few microseconds per item (about 1-2μs/query cache miss, so, including all the actions param_env makes, ~10μs/use-ish on my fairly slow laptop) - is far below the overhead of actually processing that item.

    However, if we want to just "get rid of the regression", it might be a good idea to add a bypass to param_env on item classes that can't have generics (at least, use items) that avoids the entire query mechanism. This might speed up artificial code that has a lot of generic-free items.

    And of course it's always a good idea to speed up queries.

  13. arielb1 commented on Aug 26, 2018

    @arielb1
    Contributor

    I would lower this issue to P-medium unless someone actually cares about this case, this code is going to get refactored to death anyway.

  14. removed their assignment
    on Aug 30, 2018
  15. pnkfelix commented on Aug 30, 2018

    @pnkfelix
    Contributor

    downgrading to P-medium on basis on analysis and arguments presented by @arielb1 above.

  16. added and removed
    P-highHigh priority
    on Aug 30, 2018
  17. added
    regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.
    and removed on Sep 20, 2018
  18. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Feb 8, 2020
  19. Mark-Simulacrum commented on Jan 16, 2024

    @Mark-Simulacrum
    Member

    Given it's been 5(!) years I don't think there's value in keeping this open -- at best, this is tracking "can we make unused-warnings faster?" which feels like not a useful thing to track.

  20. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    and removed
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.I-compiletimeIssue: Problems and improvements with respect to compile times.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions