Skip to content

Call stats are incorrect for tier 2 and maybe for tier 1 as well #118036

Description

@markshannon

Bug report

Bug description:

The call stats for tier 2 differ significantly from tier 1, but it is not clear that the tier 1 call stats are correct either.

The main purpose of the call stats is to track the fraction of Python frames that are created with and without calls to PyEval_EvalDefault. However, the stats don't make that clear and may be incorrect.

Currently the table looks like this:

CountRatio
Calls to PyEval_EvalDefault2,309,411,11032.0%
Calls to Python functions inlined4,908,275,08768.0%
Calls via PyEval_EvalFrame (total)2,309,411,11032.0%
Calls via PyEval_EvalFrame (vector)1,447,866,96220.1%
Calls via PyEval_EvalFrame (generator)861,544,14811.9%
Calls via PyEval_EvalFrame (legacy)4,418,4640.1%
Calls via PyEval_EvalFrame (function vectorcall)1,443,417,87220.0%
Calls via PyEval_EvalFrame (build class)30,6260.0%
Calls via PyEval_EvalFrame (slot)475,837,7066.6%
Calls via PyEval_EvalFrame (function ex)38,365,0960.5%
Calls via PyEval_EvalFrame (api)256,353,6003.6%
Calls via PyEval_EvalFrame (method)213,159,1353.0%
Frame objects created88,466,8531.2%
Frames pushed4,953,781,86868.6%

Note that the numbers don't add up.
The number of "frames pushed" is actually the total number of frames created. As it is function frames pushed, generator frames are not counted.

Frame objects created should be a fraction of "frames created". All other numbers should be a fraction of "frames pushed"

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions