8000 Draft: gh-127119: Faster check for small ints in long_dealloc (debug) by eendebakpt · Pull Request #128187 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Draft: gh-127119: Faster check for small ints in long_dealloc (debug) #128187

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

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cfb70cb
Faster check for small ints in long_dealloc
eendebakpt Dec 4, 2024
426dd09
📜🤖 Added by blurb_it.
blurb-it[bot] Dec 4, 2024
4639642
Use int immortality bit for small int check
eendebakpt Dec 5, 2024
d9c26d3
Merge branch 'small_int_immortal_v2' of github.com:eendebakpt/cpython…
eendebakpt Dec 5, 2024
2f73d47
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 5, 2024
3b6e1fe
fix compiler warnings
eendebakpt Dec 5, 2024
03184a7
Merge branch 'small_int_immortal_v2' of github.com:eendebakpt/cpython…
eendebakpt Dec 5, 2024
5eca812
compiler warnings
eendebakpt Dec 5, 2024
fedc102
some documentation updates
eendebakpt Dec 5, 2024
c733d25
Update Objects/longobject.c
eendebakpt Dec 5, 2024
829a595
Merge branch 'small_int_immortal_v2' of github.com:eendebakpt/cpython…
eendebakpt Dec 5, 2024
39da0ea
Update Tools/gdb/libpython.py
eendebakpt Dec 5, 2024
5058e53
tests!
eendebakpt Dec 5, 2024
8a3d00f
tests!
eendebakpt Dec 5, 2024
878207a
update _PyLong_IsNonNegativeCompact
eendebakpt Dec 5, 2024
068a16a
Apply suggestions from code review
eendebakpt Dec 11, 2024
a65ec5a
review comments
eendebakpt Dec 11, 2024
38fe25f
Merge branch 'small_int_immortal_v2' of github.com:eendebakpt/cpython…
eendebakpt Dec 11, 2024
32b6e44
spacing
eendebakpt Dec 11, 2024
8543c78
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 11, 2024
e232ca4
Update Tools/gdb/libpython.py
eendebakpt Dec 11, 2024
f1ce753
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 13, 2024
99a2fc7
whitespace
eendebakpt Dec 13, 2024
f6a76b0
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 17, 2024
9894866
Apply suggestions from code review
eendebakpt Dec 17, 2024
7834406
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 18, 2024
d91b6e3
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 20, 2024
ebc7e17
Update Modules/_testcapi/immortal.c
eendebakpt Dec 22, 2024
aaf110b
Update Modules/_testcapi/immortal.c
eendebakpt Dec 22, 2024
8fcc1d0
Update Include/cpython/longintrepr.h
eendebakpt Dec 22, 2024
aff8812
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 22, 2024
ebb0bca
review comments
eendebakpt Dec 22, 2024
8d8e794
include pycore_long.h
eendebakpt Dec 22, 2024
4a07ba1
header
eendebakpt Dec 22, 2024
1d5b2e0
include pycore_long.h
eendebakpt Dec 22, 2024
cfb9120
debug build failure
eendebakpt Dec 22, 2024
b606c09
Merge branch 'main' into small_int_immortal_v2
eendebakpt Dec 23, 2024
b4c8444
fix bug when copying the immortal bit
eendebakpt Dec 23, 2024
3a553d1
test small int test
eendebakpt Dec 23, 2024
62939d1
print
eendebakpt Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
some documentation updates
  • Loading branch information
eendebakpt committed Dec 5, 2024
commit fedc102ec8d9a33b99bfd49b87de57b4d8187c02
4 changes: 2 additions & 2 deletions Include/cpython/longintrepr.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ typedef long stwodigits; /* signed variant of twodigits */
- 1: Zero
- 2: Negative

The third lowest bit of lv_tag is reserved for an immortality flag, but is
not currently used.
The third lowest bit of lv_tag is reserved for an immortality flag, and is
set to 1 for the small ints.

In a normalized number, ob_digit[ndigits-1] (the most significant
digit) is never zero. Also, in all cases, for all valid i,
Expand Down
6 changes: 3 additions & 3 deletions Tools/gdb/libpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ class PyLongObjectPtr(PyObjectPtr):

def proxyval(self, visited):
'''
Python's Include/longinterpr.h has this declaration:
Python's Include/cpython/longinterpr.h has this declaration:

typedef struct _PyLongValue {
uintptr_t lv_tag; /* Number of digits, sign and flags */
Expand All @@ -909,8 +909,8 @@ def proxyval(self, visited):
- 0: Positive
- 1: Zero
- 2: Negative
The third lowest bit of lv_tag is reserved for an immortality flag, but is
not currently used.
The third lowest bit of lv_tag is reserved for an immortality flag,and is
set to 1 for the small ints.

where SHIFT can be either:
#define PyLong_SHIFT 30
Expand Down
0