Skip to content

Build simple profiling tooling #412

Open
@braxtonmckee

Description

@braxtonmckee

For instance, a flag could be set that adds instrumentation to every compiled TP function counting every time we enter a function and every outgoing callsite. At each point, we'd end up with a new global variable (we'd have to add something to GlobalVariableDefinition to model this) containing a raw pointer to an integer and we'd just increment it nakedly every time we execute.

We could then walk back over the stats and figure out which function call sites were being used.

An alternative would be for each thread to have its own 'event pointer ring buffer' and we'd write events into the ring buffer, which could conceivably be richer data, since it would tell us the ordering of events and also let us use sampling to determine where a program was spending its time.

Either way, the goal would be to make a first step towards being able to tell where a TP program is spending its time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compilerIssue that does not affect the un-compiled subset of typed_pythonenhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions