diff --git a/pyobjc-core/Tools/pyobjcbench.py b/pyobjc-core/Tools/pyobjcbench.py index b07a16764a..b6fb85275e 100644 --- a/pyobjc-core/Tools/pyobjcbench.py +++ b/pyobjc-core/Tools/pyobjcbench.py @@ -72,3 +72,17 @@ def print_bench(title, time): stmt="m()", ), ) +print() +print_bench( + "python function call", + timeit.timeit(setup="import math; f=math.sin", stmt="f(5.0)"), +) +setup = """ +import objc +objc.loadBundleFunctions(None, globals(), [("sin", b"dd")]) +f = sin +""" +print_bench( + "objc function call", + timeit.timeit(setup=setup, stmt="f(5.0)"), +)