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.
This commit is contained in:
Paul Sokolovsky 2014-05-07 22:07:10 +03:00
parent 2a05f05f44
commit 69cbec4afb
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//20)):
enumerate([1, 2], 1)
bench.run(test)

View File

@ -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)