Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bpo-40521: Remove freelist from collections.deque() #21073

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

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Jun 23, 2020

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

But I'm curious, why removing it? The free list is not longer faster than always calling PyMem_Malloc/PyMem_Free?

Previously, PyMem_Malloc/PyMem_Free called libc malloc/free. But now it's the pymalloc memory allocator which is faster than libc allocator for small memory allocation (up to 512 bytes). Maybe pymalloc made the free list less interesting?

@rhettinger
Copy link
Contributor Author

Deques only call the allocator once every 64 updates, so the average cost is small.

@rhettinger rhettinger merged commit 32f2eda into python:master Jun 23, 2020
fasih pushed a commit to fasih/cpython that referenced this pull request Jun 29, 2020
arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
rhettinger added a commit to rhettinger/cpython that referenced this pull request Mar 20, 2021
…-21073)"

This reverts commit 32f2eda.
It can be re-applied if the subinterpreter PEP is approved.
Otherwise, the commit degraded performance with no offsetting
benefit.
rhettinger added a commit that referenced this pull request Mar 25, 2021
…" (GH-24944)

This reverts commit 32f2eda.
It can be re-applied if the subinterpreter PEP is approved.
Otherwise, the commit degraded performance with no offsetting
benefit.
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.

4 participants