Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify interleave. #181

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Simplify interleave. #181

wants to merge 4 commits into from

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