Skip to content

Conversation

groutr
Copy link

@groutr groutr commented Aug 22, 2022

Simplified the implementation of interleave and made it slightly faster.

seqs = [range(1000) for i in range(100)]
%timeit list(interleave(seqs))

old: 5.07 ms ± 240 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
new: 4.03 ms ± 45.6 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

@groutr groutr changed the title Simplify up interleave. Simplify interleave. Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant