MCPcopy Index your code
hub / github.com/python/cpython / method_caller

Function method_caller

Tools/ftscalingbench/ftscalingbench.py:209–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207
208@register_benchmark
209def method_caller():
210 mc = methodcaller("func")
211 obj = MyClass()
212 for i in range(1000 * WORK_SCALE):
213 mc(obj)
214
215@dataclass
216class MyDataClass:

Callers

nothing calls this directly

Calls 3

methodcallerClass · 0.90
mcFunction · 0.85
MyClassClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…