-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Open
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement
Description
This came up in context of numpy/numpy#30494.
Currently the raw allocator (PyMem_RawMalloc and friends) uses the system allocator because it should be possible to call these APIs without an active thread state. pymalloc requires an active thread state hence that cannot be used, however on free-threading we can instead use mimalloc instead of directly calling the system allocator.
Using mimalloc instead of system allocator I see much less contention while freeing the memory on macos, see the benchmark on the numpy issue on how to reproduce the issue.
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement