Skip to content

bpo-40369: Use PEP 590 vectorcall to speed up GenericAlias#19677

Closed
corona10 wants to merge 4 commits intopython:masterfrom
corona10:bpo-40369
Closed

bpo-40369: Use PEP 590 vectorcall to speed up GenericAlias#19677
corona10 wants to merge 4 commits intopython:masterfrom
corona10:bpo-40369

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Apr 23, 2020

@corona10 corona10 changed the title bpo-40369: Use PEP 590 vectorcall to speed up GenericAlias. bpo-40369: Use PEP 590 vectorcall to speed up GenericAlias Apr 23, 2020
@corona10 corona10 requested review from gvanrossum and vstinner April 23, 2020 12:56
@corona10 corona10 force-pushed the bpo-40369 branch 2 times, most recently from 29fec8a to 8ace18e Compare April 23, 2020 13:43
}
if (PyTuple_GET_SIZE(args) != 2) {
PyErr_SetString(PyExc_TypeError, "GenericAlias expects 2 positional arguments");
if (!_PyArg_CheckPositional("GenericAlias", PyTuple_GET_SIZE(args), 2, 2)) {
Copy link
Member

Choose a reason for hiding this comment

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

I like these specialized error checks, but I doubt the vector call helps much. I'd rather try adding a cache like we have in typing.py.

Copy link
Member

Choose a reason for hiding this comment

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

I like the idea of a cache. In term of performance, it's usually hard to beat a cache ;-)

Copy link
Member Author

Choose a reason for hiding this comment

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

@gvanrossum @vstinner cc @serhiy-storchaka
I agree with guido's opinion, hmm looks like this PR should be closed.
Is it okay to open the sperate PR for specialized error checks?

Copy link
Member

Choose a reason for hiding this comment

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

You can open a separated PR changes on the error code.

Yeah, I suggest to close this PR.

Copy link
Member Author

@corona10 corona10 Apr 23, 2020

Choose a reason for hiding this comment

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

You can open a separated PR changes on the error code.

Thanks, I will do.

@corona10 corona10 closed this Apr 23, 2020
@corona10 corona10 deleted the bpo-40369 branch April 23, 2020 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants