bpo-40369: Use PEP 590 vectorcall to speed up GenericAlias#19677
bpo-40369: Use PEP 590 vectorcall to speed up GenericAlias#19677corona10 wants to merge 4 commits intopython:masterfrom
Conversation
29fec8a to
8ace18e
Compare
| } | ||
| 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)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I like the idea of a cache. In term of performance, it's usually hard to beat a cache ;-)
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
You can open a separated PR changes on the error code.
Yeah, I suggest to close this PR.
There was a problem hiding this comment.
You can open a separated PR changes on the error code.
Thanks, I will do.
https://bugs.python.org/issue40369