diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-07 22:07:10 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-07 22:34:06 +0300 |
commit | 69cbec4afb3ac191334f0cfc5bfa14b2cdefea4c (patch) | |
tree | e744acfd265c1348f8a6f96edf9c62216da1d021 /tests/bench/func_builtin-2-enum_kw.py | |
parent | 2a05f05f4468bc937e412e94df75da9dce9a6148 (diff) | |
download | micropython-69cbec4afb3ac191334f0cfc5bfa14b2cdefea4c.tar.gz micropython-69cbec4afb3ac191334f0cfc5bfa14b2cdefea4c.zip |
tests/bench: Add testcase for positional/kwargs to enumerate().
Inspired by discussion in #577. So, in this case of builtin function,
passing args by keyword has less than 1% overhead.
Diffstat (limited to 'tests/bench/func_builtin-2-enum_kw.py')
-rw-r--r-- | tests/bench/func_builtin-2-enum_kw.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/bench/func_builtin-2-enum_kw.py b/tests/bench/func_builtin-2-enum_kw.py new file mode 100644 index 0000000000..6c5e44419c --- /dev/null +++ b/tests/bench/func_builtin-2-enum_kw.py @@ -0,0 +1,7 @@ +import bench + +def test(num): + for i in iter(range(num//20)): + enumerate(iterable=[1, 2], start=1) + +bench.run(test) |