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:
parent
2a05f05f44
commit
69cbec4afb
|
@ -0,0 +1,7 @@
|
|||
import bench
|
||||
|
||||
def test(num):
|
||||
for i in iter(range(num//20)):
|
||||
enumerate([1, 2], 1)
|
||||
|
||||
bench.run(test)
|
|
@ -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)
|
Loading…
Reference in New Issue