robertwb / issues-import-test

0 stars 0 forks source link

Optimise for-in-zip() loops when all loop variables have non-Python types #104

Open robertwb opened 7 years ago

robertwb commented 7 years ago

Reported by scoder on 1 Oct 2015 22:21 UTC Probably just a bit of a wild idea, but this:

def test(a, b):
    cdef int x, y
    for x, y in zip(a, b):
        ...

could be optimised using a Cython-implemented helper function template for zip() that calls next() separately on all iterators, converts the values to their specific target types (thus a template) and returns a ctuple instead of a Python tuple.

Migrated-From: http://trac.cython.org/ticket/871