You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
e53d2197e4
For a trivial operation, calling a function is 5 times slower than doing operation inline.
13 lines
213 B
Python
13 lines
213 B
Python
# Function call overhead test
|
|
# Perform the same trivial operation as global function call
|
|
import bench
|
|
|
|
def f(x):
|
|
return x + 1
|
|
|
|
def test(num):
|
|
for i in iter(range(num)):
|
|
a = f(i)
|
|
|
|
bench.run(test)
|