FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-90997: Improve inline cache performance for MSVC by brandtbucher · Pull Request #96781 · python/cpython · GitHub

Repository navigation

GH-90997: Improve inline cache performance for MSVC - #96781

Merged
brandtbucher merged 3 commits into
python:mainfrom
brandtbucher:memcpy
Sep 15, 2022
Merged

brandtbucher merged 3 commits into
python:mainfrom
brandtbucher:memcpy

Conversation

brandtbucher commented Sep 12, 2022 •
edited
Loading

Copy link
Copy Markdown
Member

This Compiler Explorer snippet suggests that MSVC doesn't optimize away our cache read/write utilities the way that Clang and GCC do. However, it also shows that replacing our current shifting implementations with memcpy calls does exactly what we want, in a standard-defined way, on all three compilers. I think the memcpy version is a bit nicer, especially since we don't need to maintain two differently-endian versions of the same code.

I'm curious if this moves the benchmarks at all, but I don't have a good Windows pyperformance setup figured out yet. So maybe somebody else could help me out with some numbers on this? (@gvanrossum, I think I remember that you were able to get kinda-stable MSVC numbers a while back?)

brandtbucher added performance Performance or resource usage interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Sep 12, 2022
brandtbucher self-assigned this Sep 12, 2022

Copy link
Copy Markdown
Member

I'm reluctant to spend time getting stable benchmarks for this on Windows, last time it took me an afternoon to run the benchmarks several times with and without the patches. Let's wait until we have a Windows benchmarking machine, please?

markshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The changes in MSVC output are a clear improvement, and seems to have a positive effect elsewhere.
Even on RISC-V which doesn't support unaligned access, the code is a bit better: https://godbolt.org/z/Ydx5roTa7

Comment thread Include/internal/pycore_code.h Outdated

Copy link
Copy Markdown
Member Author

Looks like even GCC benefits on 64-bit ARM: https://godbolt.org/z/MTj3anj4c

brandtbucher added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 14, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @brandtbucher for commit 5985a4a 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 14, 2022

Copy link
Copy Markdown
Contributor

LGTM

brandtbucher merged commit a83fdf2 into python:main Sep 15, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL