Skip to content

3.11: Performance regression in ctypes #92356

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
mdboom opened this issue May 5, 2022 · 0 comments
Closed

3.11: Performance regression in ctypes #92356

mdboom opened this issue May 5, 2022 · 0 comments
Labels
performance Performance or resource usage topic-ctypes type-bug An unexpected behavior, bug, or error

Comments

@mdboom
Copy link
Contributor

mdboom commented May 5, 2022

Bug report

There is an approximately 8% performance regression in function call overhead in ctypes in py3.11.0a7 vs. py3.10.4. On my machine, 280 ns/call vs. 235 ns/call.

Gist to reproduce.

Additional context in faster-cpython/ideas#370.

Your environment

Both Python versions built from source with pgo on Fedora Linux 36, x86_64.

@mdboom mdboom added the type-bug An unexpected behavior, bug, or error label May 5, 2022
@AlexWaygood AlexWaygood added performance Performance or resource usage topic-ctypes labels May 5, 2022
mdboom added a commit to mdboom/cpython that referenced this issue May 5, 2022
38f331d introduced a delayed initialization routine to set up
ctypes formattable (`_ctypes_init_fielddesc`), but inadvertently
removed setting the `initialization` flag to 1 to avoid initting
each time.
JelleZijlstra pushed a commit that referenced this issue May 6, 2022
38f331d introduced a delayed initialization routine to set up
ctypes formattable (`_ctypes_init_fielddesc`), but inadvertently
removed setting the `initialization` flag to 1 to avoid initting
each time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage topic-ctypes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants