-
Notifications
You must be signed in to change notification settings - Fork 416
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 ZipLongest
implementation
#905
Simplify ZipLongest
implementation
#905
Conversation
NB: Depends on #901. |
Duplicate in the sense that both separate the implementations of the three zip functions, yes. However, #715 uses T4 to generate separate implementations of each method for argument count 2-4. Also, #715 and #905 have very different implementations (subject to debate which is better).
|
Some thoughts about this:
|
I did do some testing, and while the memory usage is negligible (400b vs 176b), it does cost an additional 30-50% to do it the #905 way. Probably has mostly to do with the extra
Not sure that this is a concern. Asking for more than 4 enumerables to be zipped together seems a little excessive, and should probably be solved by the person requesting it.
Already discussed and addressed in #901/#936. I won't repeat the discussion further here. |
Hey @Orace, I took your idea and managed to improve performance by another 10-20%. Feel free to take a look at the updated Closing this PR in favor of an updated #715. |
The various Zip* methods currently share implementation in
.ZipImpl()
. However, the code is simpler for each one when they are written separately; that is, in this case, the variances are more than the commonality. As such, we should allow each method to be implemented separately.This PR updates the implementation of
ZipLongest
to be done separately from.ZipImpl()
.