2014-06-18 20:20:34 -04:00
|
|
|
# Function call overhead test
|
|
|
|
# Perform the same trivial operation as global function call
|
|
|
|
import bench
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2014-06-18 20:20:34 -04:00
|
|
|
def f(x):
|
|
|
|
return x + 1
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2014-06-18 20:20:34 -04:00
|
|
|
def test(num):
|
|
|
|
for i in iter(range(num)):
|
|
|
|
a = f(i)
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2014-06-18 20:20:34 -04:00
|
|
|
bench.run(test)
|