Skip to content

bpo-38613: Optimize set operations of dict keys.#16961

Merged
methane merged 5 commits into
python:masterfrom
methane:optimize-dictkeys
Nov 7, 2019
Merged

bpo-38613: Optimize set operations of dict keys.#16961
methane merged 5 commits into
python:masterfrom
methane:optimize-dictkeys

Conversation

@methane

@methane methane commented Oct 28, 2019

Copy link
Copy Markdown
Member

@rhettinger

Copy link
Copy Markdown
Contributor

+1 This looks like a nice improvement.

@methane methane removed the skip news label Oct 29, 2019
Comment thread Objects/dictobject.c Outdated
Comment thread Objects/dictobject.c
Comment thread Objects/dictobject.c

tmp = _PyObject_CallMethodIdOneArg(result, &PyId_difference_update, other);
_Py_IDENTIFIER(difference_update);
PyObject *tmp = _PyObject_CallMethodIdOneArg(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am wondering whether calling set.difference_update(result, other) using fast call can be faster than calling result.difference_update(other). But this is for other issue.

@methane methane merged commit 6cbc84f into python:master Nov 7, 2019
@methane methane deleted the optimize-dictkeys branch November 7, 2019 15:59
@serhiy-storchaka

Copy link
Copy Markdown
Member

LGTM. Sorry, forgot to approve the PR.

jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance or resource usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants