[issue47067] Add vectorcall for generica alias object

2022-03-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 1ea055bd53ccf976e88018983a3c13447c4502be by penguin_wwy in branch 'main': bpo-47067: Optimize calling GenericAlias objects (GH-31996) https://github.com/python/cpython/commit/1ea055bd53ccf976e88018983a3c13447c4502be -- ___

[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread penguin_wwy
penguin_wwy <940375...@qq.com> added the comment: > You could also try replacing PyObject_SetAttrString with PyObject_SetAttr and > adding "__orig_class__" to the global strings with > Tools/scripts/generate_global_objects.py, probably for a later PR. Already done via `make regen-global-objec

[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: I profiled dict[str, int](a=1, b=2), and it looks like a decent chunk of time comes from PyUnicode_New as used by PyObject_SetAttrString. You could also try replacing PyObject_SetAttrString with PyObject_SetAttr and adding "__orig_class__" to the global stri

[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread Guido van Rossum
Guido van Rossum added the comment: @Dennis, if/when the PR looks good to you, you can merge it. -- ___ Python tracker ___ ___ Pyth

[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread penguin_wwy
penguin_wwy <940375...@qq.com> added the comment: There is a small problem with the example: ``` d = dict[int] ``` should ``` d = dict[str, int] ``` -- ___ Python tracker __

[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +JelleZijlstra, gvanrossum, kj ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread penguin_wwy
penguin_wwy <940375...@qq.com> added the comment: The point of bpo-40369 issue seems to be to provide vectorcall to the `GenericAliasType`, means vectorcall for `Queue[int]` However, my idea is to add vectorcall to gaobject, like this: ``` d = dict[int] d(a=1, b=2) <-- vectorcall ``` The idea

[issue47067] Add vectorcall for generica alias object

2022-03-19 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +Dennis Sweeney ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue47067] Add vectorcall for generica alias object

2022-03-19 Thread Dong-hee Na
Dong-hee Na added the comment: We decided not to add it see bpo-40369 -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-li

[issue47067] Add vectorcall for generica alias object

2022-03-19 Thread penguin_wwy
Change by penguin_wwy <940375...@qq.com>: -- keywords: +patch pull_requests: +30085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31996 ___ Python tracker __

[issue47067] Add vectorcall for generica alias object

2022-03-19 Thread penguin_wwy
New submission from penguin_wwy <940375...@qq.com>: Although `ga_call` determines whether `origin` has a vectorcall, it needs to be unpacked the parameters that are already packed. /-> origin.vectorcall(unpacked) MakeTpCall(packed) -> ga_call -> PyO