Skip to content

BUILD_INTERPOLATION and BUILD_TEMPLATE perform unnecessary refcount operations #145860

@markshannon

Description

@markshannon

Feature or enhancement

Proposal:

BUILD_INTERPOLATION and BUILD_TEMPLATE call _PyInterpolation_Build and _PyTemplate_Build respectively, and then decref their arguments. All other BUILD instructions call a "steal" function, to avoid the unnecessary incref then decref. BUILD_INTERPOLATION and BUILD_TEMPLATE should do the same.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions