tests/bench: Add testcase to compare bytes(N) vs b"\0" * N.
Based on python-dev discussion regarding PEP467.
This commit is contained in:
parent
bba77a2d01
commit
e918fc5e37
7
tests/bench/bytealloc-1-bytes_n.py
Normal file
7
tests/bench/bytealloc-1-bytes_n.py
Normal file
@ -0,0 +1,7 @@
|
||||
import bench
|
||||
|
||||
def test(num):
|
||||
for i in iter(range(num // 1000)):
|
||||
bytes(10000)
|
||||
|
||||
bench.run(test)
|
7
tests/bench/bytealloc-2-repeat.py
Normal file
7
tests/bench/bytealloc-2-repeat.py
Normal file
@ -0,0 +1,7 @@
|
||||
import bench
|
||||
|
||||
def test(num):
|
||||
for i in iter(range(num // 1000)):
|
||||
b"\0" * 10000
|
||||
|
||||
bench.run(test)
|
Loading…
Reference in New Issue
Block a user