Message197256
An additional speedup would be to add a "if len(h) == 1" check inside the while loop, and just yield from the remaining iterator if a single iterable remains. This would also speed up merges with multiple inputs, as it doesn't do the whole heapreplace() loop for the last remaining iterable. Example: merge([], [], [], range(100000). This would involve some more refactoring inside the function though, since the current implementation only stores the .next() function for each iterable. |
|
Date |
User |
Action |
Args |
2013-09-08 12:14:44 | wbolster | set | recipients:
+ wbolster, rhettinger |
2013-09-08 12:14:44 | wbolster | set | messageid: <1378642484.2.0.326348227301.issue18962@psf.upfronthosting.co.za> |
2013-09-08 12:14:44 | wbolster | link | issue18962 messages |
2013-09-08 12:14:44 | wbolster | create | |
|