Skip to content

Porting argclinic socket.__init__ from Cinder. #92210

Closed

Description

@zitterbewegung

Enhancement of socket.init to use argument clinic

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.

Activity

  1. added
    type-feature
    on May 3, 2022
  2. MojoVampire commented on May 3, 2022

    @MojoVampire
    Contributor

    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.

  3. zitterbewegung commented on May 3, 2022

    @zitterbewegung
    ContributorAuthor

    Thanks @MojoVampire I have revised my issue from your comment.

  4. changed the title [-]Porting use of argclinic socket.__init__ from Cinder.[/-] [+]Porting argclinic socket.__init__ from Cinder.[/+] on May 3, 2022
  5. added 2 commits that reference this issue on May 4, 2022
  6. JelleZijlstra commented on May 4, 2022

    @JelleZijlstra
    Member

    Thanks for your patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions