This website requires JavaScript.
Explore
Help
Sign In
djsundog
/
circuitpython
Watch
1
Star
0
Fork
You've already forked circuitpython
0
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
2a5fe57e43
circuitpython
/
tests
/
bench
/
var-2-global.py
13 lines
112 B
Python
Raw
Normal View
History
Unescape
Escape
tests: Add framework for comparative benchmarking. 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.
2014-05-04 18:24:16 -04:00
import
bench
ITERS
=
20000000
run code formatting script
2021-03-15 09:57:36 -04:00
tests: Add framework for comparative benchmarking. 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.
2014-05-04 18:24:16 -04:00
def
test
(
num
)
:
i
=
0
while
i
<
ITERS
:
i
+
=
1
run code formatting script
2021-03-15 09:57:36 -04:00
tests: Add framework for comparative benchmarking. 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.
2014-05-04 18:24:16 -04:00
bench
.
run
(
test
)