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-27575: port set intersection logic into dictview intersection #7696

Open
wants to merge 11 commits into
base: master
from

Conversation

Projects
None yet
7 participants
@fgregg
Copy link

commented Jun 14, 2018

This turns a patch contributed by @dsu1995 on bpo into a github PR.

The patch ports the logic of set intersection into the intersection of dictviews. It will address performance issues when taking the intersection of large dictviews.

https://bugs.python.org/issue27575

@the-knights-who-say-ni

This comment has been minimized.

Copy link

commented Jun 14, 2018

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

When your account is ready, please add a comment in this pull request
and a Python core developer will remove the CLA not signed label
to make the bot check again.

Thanks again for your contribution, we look forward to reviewing it!

@fgregg

This comment has been minimized.

Copy link
Author

commented Jun 15, 2018

@rhettinger, this PR is ready for review. I've verified all the code paths are covered by the tests.

@Mariatta

This comment has been minimized.

Copy link
Member

commented Jun 15, 2018

Friendly reminder to use "Co-authored by" in the commit message in situations like this, where patch was originally started by someone else. Thanks.

Devguide reference
GitHub article

@fgregg

This comment has been minimized.

Copy link
Author

commented Jun 16, 2018

Hi @Mariatta!

I wasn't sure if that guidance applied here, because I didn't apply @dsu1995 patches and them make a new commit. Instead, I cherry-picked from his git branch.

As such, David Su is already listed as the sole author of his commits.

If this is not the preferred option, I can redo this branch so that it does not have @dsu1995's commits and instead just has a commit where I applied his patch. In that commit I will list him as the Co-Author in the commit message.

Please advise.

@methane methane self-requested a review Apr 11, 2019

if (rv < 0)
goto error;
if (rv) {
if (PySet_Add(result, key)) {

This comment has been minimized.

Copy link
@ZackerySpytz

ZackerySpytz Apr 11, 2019

Contributor

This if can be combined with the previous one.

return result;

error:

This comment has been minimized.

Copy link
@ZackerySpytz

ZackerySpytz Apr 11, 2019

Contributor

There is an extra level of indentation here (and under this label).

Py_DECREF(it);
Py_DECREF(result);
Py_DECREF(key);
return NULL;

This comment has been minimized.

Copy link
@methane

methane Apr 12, 2019

Member

Dedent these 5 lines.

PyObject *key;
Py_ssize_t len_self;
int rv;
int (*dict_contains)(_PyDictViewObject *, PyObject *);

This comment has been minimized.

Copy link
@methane

methane Apr 12, 2019

Member

Please define local variables when they are initialized.

For example

int rv = dict_contains((_PyDictViewObject *)self, key);
@bedevere-bot

This comment has been minimized.

Copy link

commented Apr 12, 2019

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@@ -0,0 +1,2 @@
Improve speed of dictview intersection by directly using set intersection
logic. Patch by David Hsu.

This comment has been minimized.

Copy link
@dsu1995

dsu1995 Apr 13, 2019

typo: David Su

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.