Skip to content

Add gc collection time to gc callbacks #140515

@sergey-miryanov

Description

@sergey-miryanov

Feature or enhancement

Proposal:

During the last performance meeting, Brandt requested that the GC collection time be added to the GC callbacks.

I propose to extend the information that GC provides for callbacks as follows:

start {'generation': 2, 'collected': 0, 'uncollectable': 0}
stop {'generation': 2, 'collected': 21, 'uncollectable': 0, 'collection_time': 0.1285373}

We do not change anything for the start event. For the 'stop' event, we add collection_time which is the collection time in seconds.

@brandtbucher Would this work for you?

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions