Optimize windowed itertool#810
Conversation
Making line length shorter Remove erronious inclusion of old method
03ddadf to
ed4f9f3
Compare
|
I'm -0 on this one - the better performance for larger size inputs is good, but I'm not sure if the extra complexity is worth it. |
|
I can test out the performance of the single non-overlapping branch but I really do think non initializing a deque if possible is the way to go here. I will see if I can optimize further. |
|
Newest changes improve every metric minorly anywhere from 0-40% speed up over base code. Not huge but considering this is one of the most widely used methods and is used all over this code base as well it should provide a nice bonus. See the issue (#809) for new metrics |
|
Thanks for the analysis. I'll take this PR if you can revert the change to the argument names? |
|
@bbayles Done, I will avoid changing argument names in the future. Thanks! |
Issue reference
#809
Changes
I have been working towards increasing the performance of the windowed method and have made some good headway. Main performance gains come from using built in itertools methods and using
isliceto "fast forward" the windows.