tests/bench: Add testcase to compare bytes(N) vs b"\0" * N.

Based on python-dev discussion regarding PEP467.
This commit is contained in:
Paul Sokolovsky 2016-06-08 14:28:18 +03:00
parent bba77a2d01
commit e918fc5e37
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,7 @@
import bench
def test(num):
for i in iter(range(num // 1000)):
bytes(10000)
bench.run(test)

View File

@ -0,0 +1,7 @@
import bench
def test(num):
for i in iter(range(num // 1000)):
b"\0" * 10000
bench.run(test)