Commit 4f65182c authored by Stefan Behnel's avatar Stefan Behnel

optimised benchmark

parent 3e37c134
...@@ -3,12 +3,15 @@ ...@@ -3,12 +3,15 @@
COUNT = 10000 COUNT = 10000
import cython
@cython.locals(N=cython.Py_ssize_t)
def count_to(N): def count_to(N):
for i in range(N): for i in range(N):
yield i yield i
def round_robin(*iterators): def round_robin(*_iterators):
iterators = list(iterators) iterators = list(_iterators)
to_drop = [] to_drop = []
while iterators: while iterators:
for i, it in enumerate(iterators): for i, it in enumerate(iterators):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment