Skip to content

Stackrefs (#118450) introduced a large performance regression on Windows  #121263

Description

@mdboom

Bug description:

#118450 "Convert the evaluation stack to stack refs" (by @Fidget-Spinner) unfortunately seems to have introduced a 7% - 11% performance regression overall (though as much as 25% for some benchmarks) on Windows only. Linux (both x86_64 and aarch64) and macOS (arm) seem to have a change beneath the noise threshold. To be clear, @Fidget-Spinner's work is great and the lesson here is that for these sorts of sweeping low-level changes, we should have benchmarked on all of the Tier 1 platforms to be certain.

I don't know what the cause is -- it is probably MSVC not being able to "optimize through" something and introducing unnecessary overhead, but that's just a theory.

Cc: @brandtbucher, @markshannon

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Activity

  1. Fidget-Spinner commented on Jul 2, 2024

    @Fidget-Spinner
    Member

    @mdboom Thanks for bringing this up! In the past this was usually due to MSVC not being able to inline in the eval loop because its too big of a function. I can change all the static inlines to macros and try benchmarking again?

  2. mdboom commented on Jul 2, 2024

    @mdboom
    ContributorAuthor

    I can change all the static inlines to macros and try benchmarking again?

    Sounds like a good first thing to try. Thanks!

  3. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    3.14bugs and security fixes
    on Jul 2, 2024
  4. added a commit that references this issue on Jul 3, 2024
  5. added a commit that references this issue on Jul 11, 2024
  6. added a commit that references this issue on Jul 17, 2024
  7. added a commit that references this issue on Jul 19, 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

    3.14bugs and security fixesOS-windowsinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions