python / python/cpython

use argument clinic for more socket functions

Open
#135,748 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extension-modules performance topic-argument-clinic topic-socket type-refactor
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Some methods of socket still uses VARARGS calling convention which is slow, AC can be used to simplify arg parsing as well as speed up the arg parsing. This is important for asyncio as it heavily calls these API.

This shows up in asyncio flame graphs as well:

Image

Linked PRs
  • gh-135749
  • gh-155257

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the socket methods that still use the VARARGS calling convention and the linked PRs gh-135749 and gh-155257. Use the asyncio flame graph as context; done means the relevant socket argument parsing uses Argument Clinic and improves the reported asyncio parsing overhead.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
networking, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.