You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Porting argclinic socket.__init__ from Cinder. #92210
In cinder this enhancement that is relatively easy involves adding argument clinic to socket.init . The primary goal will make this much easier to maintain.
Coverage of argument clinic is not a goal. As for performance, the overhead of a slightly slower path to calling socket's initializer is trivial relative to the cost of actually opening a socket; optimizing away even 10% of the cost would surprise me, and while that would be worth it if it were truly a super-hot code path, in practice, I doubt even high performance web servers would be spending an appreciable fraction of their time on just creating sockets.
There's nothing wrong with improving the module as a whole to use argument clinic (it's nice to maintain less argument parsing code, while getting speedups for free when argument clinic improves), but the savings available from switching from using tp_new/tp_init to using a tp_vectorcall is mostly just avoiding the creation and parsing of a couple dicts; worth it for built-ins that get exercised a lot and are only limited by the CPU, not so much for stuff that gets used less and is typically I/O limited.
Activity
MojoVampire commentedon May 3, 2022
Coverage of argument clinic is not a goal. As for performance, the overhead of a slightly slower path to calling
socket's initializer is trivial relative to the cost of actually opening a socket; optimizing away even 10% of the cost would surprise me, and while that would be worth it if it were truly a super-hot code path, in practice, I doubt even high performance web servers would be spending an appreciable fraction of their time on just creating sockets.There's nothing wrong with improving the module as a whole to use argument clinic (it's nice to maintain less argument parsing code, while getting speedups for free when argument clinic improves), but the savings available from switching from using
tp_new/tp_initto using atp_vectorcallis mostly just avoiding the creation and parsing of a coupledicts; worth it for built-ins that get exercised a lot and are only limited by the CPU, not so much for stuff that gets used less and is typically I/O limited.zitterbewegung commentedon May 3, 2022
Thanks @MojoVampire I have revised my issue from your comment.
[-]Porting use of argclinic socket.__init__ from Cinder.[/-][+]Porting argclinic socket.__init__ from Cinder.[/+]Merge branch 'main' into pythongh-92210
gh-92210: Move socket.__init__ to argument clinic (#92237)
JelleZijlstra commentedon May 4, 2022
Thanks for your patch!