python / python/cpython

Add names to gathered stats for some events.

Open
#120,996 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Motivation

Sometimes we need to classify stats by name from an unknown set.
For example, 94% of the specialization failures for the CALL instruction is "class no vectorcall".
This is valuable information and suggests we need to implement more vectorcalls for classes.
But it doesn't tell us which classes lack vectorcalls.

Proposal

For some stats, e.g. call specialization we add the ability to record names.
If we record the first N names seen, provided N is large enough, we will see the most common names.
To avoid complications with objects and memory allocation distorting the stats, we can pre-allocate a fixed size array char names[N][M], as well as the usual table of uint64_t counts. For a table size 256, with up to 63 char names, this only uses 18kb.

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 call-specialization statistics implementation and how its events are represented. Define how a fixed-size name table and counts would capture the first N names without object or allocation effects, then verify that the resulting statistics identify common names such as classes lacking vectorcalls.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.