2014-06-19 01:20:34 +01:00
|
|
|
# Function call overhead test
|
|
|
|
# Perform the same trivial operation as global function call
|
|
|
|
import bench
|
|
|
|
|
2020-03-23 02:26:08 +00:00
|
|
|
|
2014-06-19 01:20:34 +01:00
|
|
|
def f(x):
|
|
|
|
return x + 1
|
|
|
|
|
2020-03-23 02:26:08 +00:00
|
|
|
|
2014-06-19 01:20:34 +01:00
|
|
|
def test(num):
|
|
|
|
for i in iter(range(num)):
|
|
|
|
a = f(i)
|
|
|
|
|
2020-03-23 02:26:08 +00:00
|
|
|
|
2014-06-19 01:20:34 +01:00
|
|
|
bench.run(test)
|