Skip to content
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

bpo-39453: Fix contains method of list to hold strong references #18181

Open
wants to merge 1 commit into
base: master
from

Conversation

@corona10
Copy link
Member

corona10 commented Jan 25, 2020

@corona10 corona10 requested review from pablogsal and vstinner Jan 25, 2020
@corona10 corona10 changed the title bpo-39453: Fix contains method of list to hold strong references [WIP] bpo-39453: Fix contains method of list to hold strong references Jan 25, 2020
@corona10 corona10 changed the title [WIP] bpo-39453: Fix contains method of list to hold strong references bpo-39453: Fix contains method of list to hold strong references Jan 25, 2020
@corona10 corona10 requested a review from serhiy-storchaka Jan 25, 2020
@corona10

This comment has been minimized.

Copy link
Member Author

corona10 commented Jan 25, 2020

@pablogsal @serhiy-storchaka @vstinner
All test are passed :)

Objects/listobject.c Outdated Show resolved Hide resolved
@@ -0,0 +1,2 @@
Fix contains method of list to hold strong references of elements while

This comment has been minimized.

Copy link
@rhettinger

rhettinger Jan 26, 2020

Contributor

I'm curious how much this affects or doesn't affect the search time for a long list.

This comment has been minimized.

Copy link
@corona10

corona10 Jan 26, 2020

Author Member

@rhettinger
AS-IS

./python.exe -m pyperf timeit "l = [1] * 99999" "3 in l"
.....................
Mean +- std dev: 4.53 ms +- 0.22 m

TO-BE

./python.exe -m pyperf timeit "l = [1] * 99999" "3 in l"
.....................
Mean +- std dev: 5.17 ms +- 0.21 ms
@corona10 corona10 force-pushed the corona10:bpo-39453 branch from ec79dda to 6514398 Jan 26, 2020
Copy link
Member Author

corona10 left a comment

@rhettinger I've updated the PR Please take a look :)

@corona10 corona10 requested a review from rhettinger Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.