summaryrefslogtreecommitdiffstatshomepage
path: root/tests/bench/bytealloc-2-repeat.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-06-08 14:28:18 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-06-08 14:28:18 +0300
commite918fc5e37c72d864dc369e9b9112dfa21537667 (patch)
tree143cd5d3e54f9c136a2c28b0b397fabf0f6083ff /tests/bench/bytealloc-2-repeat.py
parentbba77a2d0166918aeba8c6b8e9d8a4c3f6a8c4dd (diff)
downloadmicropython-e918fc5e37c72d864dc369e9b9112dfa21537667.tar.gz
micropython-e918fc5e37c72d864dc369e9b9112dfa21537667.zip
tests/bench: Add testcase to compare bytes(N) vs b"\0" * N.
Based on python-dev discussion regarding PEP467.
Diffstat (limited to 'tests/bench/bytealloc-2-repeat.py')
-rw-r--r--tests/bench/bytealloc-2-repeat.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/bench/bytealloc-2-repeat.py b/tests/bench/bytealloc-2-repeat.py
new file mode 100644
index 0000000000..786a804622
--- /dev/null
+++ b/tests/bench/bytealloc-2-repeat.py
@@ -0,0 +1,7 @@
+import bench
+
+def test(num):
+ for i in iter(range(num // 1000)):
+ b"\0" * 10000
+
+bench.run(test)