Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-126868: Add freelist for compact ints to _PyLong_New#128181

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kumaraditya303 merged 5 commits intopython:mainfromeendebakpt:_pylong_new_freelist
Dec 26, 2024

Conversation

@eendebakpt
Copy link
Contributor

@eendebakpteendebakpt commentedDec 22, 2024
edited by bedevere-appbot
Loading

We add freelist support to_PyLong_New (this was missed/left out in#126868). On the pyperformance suite this increases the percentage of allocations from freelist by roughly 1%. For comparison, the addition of the freelist to_PyLong_FromMedium increased the percentage by roughly 20%. Also note that_PyLong_New is used in the newPyLongWriter_Create (seehttps://peps.python.org/pep-0757/), so usage with external packages might be a bit higher.

Microbenchmark:

import pyperfdef bench_lshift(loops):    range_it = range(loops)    t0 = pyperf.perf_counter()    for ii in range_it:        _ = ii << 2    return pyperf.perf_counter() - t0if __name__ == "__main__":    runner = pyperf.Runner()    runner.bench_time_func("bench_lshift", bench_lshift)

results in:

Mean +- std dev: [main] 44.7 ns +- 3.0 ns -> [pr] 40.9 ns +- 2.3 ns: 1.09x faster

@eendebakpteendebakpt changed the titlegh-26868: Add freelist for compact ints to _PyLong_Newgh-126868: Add freelist for compact ints to _PyLong_NewDec 22, 2024
@kumaraditya303kumaraditya303enabled auto-merge (squash)December 26, 2024 14:48
@kumaraditya303kumaraditya303 merged commit3bd7730 intopython:mainDec 26, 2024
44 of 45 checks passed
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull requestJan 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@eendebakpt@kumaraditya303

[8]ページ先頭

©2009-2025 Movatter.jp