funcall-2-funcall.py 213 B

123456789101112
  1. # Function call overhead test
  2. # Perform the same trivial operation as global function call
  3. import bench
  4. def f(x):
  5. return x + 1
  6. def test(num):
  7. for i in iter(range(num)):
  8. a = f(i)
  9. bench.run(test)