Skip to content

Performance regression in PySet_Add() with 3.14t #140476

@yoney

Description

@yoney

In the fbthrift-python benchmarks, we observed a performance regression when comparing Python 3.14t to 3.14, particularly during Thrift struct initialization and deserialization. In our tests, we populated sets with 1000 elements. The regression was linked to the use of the PySet_Add() API for building set and frozenset objects, where a critical section is always applied—even when the set is uniquely referenced during initialization.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions