Commit Graph

4 Commits

Author SHA1 Message Date
Kumar Aditya a380d57873
gh-134043: use stackrefs in vectorcalling methods (#134044)
Adds `_PyObject_GetMethodStackRef` which uses stackrefs and takes advantage of deferred reference counting in free-threading while calling method objects in vectorcall.
2025-05-27 22:28:27 +05:30
Sam Gross da53660f35
gh-131586: Avoid refcount contention in context managers (gh-131851)
This avoid reference count contention in the free threading build
when calling special methods like `__enter__` and `__exit__`.
2025-04-21 15:54:25 -04:00
Sam Gross f1574859d7
gh-125985: Fix `cmodule_function()` scaling benchmark (#128460)
Add a separate benchmark that measures the effect of
`_PyObject_LookupSpecial()` on scaling.

In the process of cleaning up the scaling benchmarks for inclusion, I
unintentionally changed the "cmodule_function" benchmark to pass an
`int` to `math.floor()` instead of a `float`, which causes it to use the
`_PyObject_LookupSpecial()` code path. `_PyObject_LookupSpecial()` has
its own scaling issues that we want to measure separately from calling a
function on a C module.
2025-01-03 21:48:47 +00:00
Sam Gross 00ea179879
gh-125985: Add free threading scaling micro benchmarks (#125986)
These consist of a number of short snippets that help identify scaling
bottlenecks in the free threaded interpreter.

The current bottlenecks are in calling functions in benchmarks that call
functions (due to `LOAD_ATTR` not yet using deferred reference counting)
and when accessing thread-local data.
2024-10-28 17:47:23 -04:00