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

GH-125174: Make immortal objects more robust, following design from PEP 683 by markshannon · Pull Request #125251 · python/cpython · GitHub

Repository navigation

GH-125174: Make immortal objects more robust, following design from PEP 683 - #125251

Merged
markshannon merged 4 commits into
python:mainfrom
faster-cpython:more-robust-immortality
Oct 10, 2024
Merged

markshannon merged 4 commits into
python:mainfrom
faster-cpython:more-robust-immortality

Conversation

markshannon commented Oct 10, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

This is not a complete fix for #125174, just enough to unblock other work

markshannon added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Oct 10, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 94f8fd0 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Oct 10, 2024

Copy link
Copy Markdown
Member Author

The two "failing" refleak buildbots seem to be hanging in test.test_concurrent_futures.test_shutdown. There are no reported refleaks.

Copy link
Copy Markdown
Member Author

Performance impact:

Overall a small slowdown, with a large 7-10% slowdown on nbody.
This is almost certainly due to the regression in stack spilling around _Py_IsImmortal_Loose fixed here.

ARM 64 darwin
x86-64 linux

I'll re-run the linux benchmarks with the fix as a sanity check.

Comment thread Include/refcount.h Outdated

Copy link
Copy Markdown
Member Author

Windows shows an over 2% improvement. With the regression fixed, this I would expect this to be more than 3%.

This reason for this is that the MSVC does not convert unsigned int x; x > (1 << 31) into signed x; x < 0 as do clang and gcc.
This PR uses the signed x; x < 0 form. Hence the speedup.

Copy link
Copy Markdown
Member Author

x86-64 linux performance numbers are a bit noisy, but show no significant change.

markshannon merged commit c901437 into python:main Oct 10, 2024
markshannon deleted the more-robust-immortality branch October 10, 2024 17:20
tacaswell added a commit to tacaswell/msgspec that referenced this pull request Oct 24, 2024
python/cpython#125251 renamed
_PY_IMMORTAL_REFCNT -> _PY_IMMORTAL_INITIAL_REFCNT
jcrist added a commit to msgspec/msgspec that referenced this pull request Oct 24, 2024
* MNT: account for CPython 314 changes

python/cpython#125251 renamed
_PY_IMMORTAL_REFCNT -> _PY_IMMORTAL_INITIAL_REFCNT

* Define new macro to reduce duplication

---------

Co-authored-by: Jim Crist-Harif <jcristharif@gmail.com>
akretz added a commit to akretz/iteration_utilities that referenced this pull request Dec 4, 2025
akretz added a commit to akretz/iteration_utilities that referenced this pull request Dec 4, 2025
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL