From aaff82afe5a72ec69e05f1e56047d0acfde91d0e Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 5 May 2014 01:24:16 +0300 Subject: 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. --- tests/bench/loop_count-1-range.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/bench/loop_count-1-range.py (limited to 'tests/bench/loop_count-1-range.py') diff --git a/tests/bench/loop_count-1-range.py b/tests/bench/loop_count-1-range.py new file mode 100644 index 0000000000..e22adf6cbe --- /dev/null +++ b/tests/bench/loop_count-1-range.py @@ -0,0 +1,7 @@ +import bench + +def test(num): + for i in range(num): + pass + +bench.run(test) -- cgit v1.2.3