mirror of
https://github.com/licsber/micropython.git
synced 2024-09-21 09:30:24 +08:00
aaff82afe5
Motivation is optimizing handling of various constructs as well as understanding which constructs are more efficient in MicroPython. More info: http://forum.micropython.org/viewtopic.php?f=3&t=77 Results are wildly unexpected. For example, "optimization" of range iteration into while loop makes it twice as slow. Generally, the more bytecodes, the slower the code.
8 lines
83 B
Python
8 lines
83 B
Python
import bench
|
|
|
|
def test(num):
|
|
while num != 0:
|
|
num -= 1
|
|
|
|
bench.run(test)
|