New submission from Dennis Sweeney <sweeney.dennis...@gmail.com>:

Although the implementation of the heapq.merge function uses an underlying heap 
structure, its behavior centers on iterators. For this reason, I believe there 
should either be an alias to this function in the itertools module or at least 
a recipe in the itertools docs describing the use of heapq.merge.

Furthermore, I have an implementation (attached) of heapq.merge that is twice 
as fast for two iterables (as used in mergesort and other common cases), and is 
faster for up to 6 or 7 iterables. I think it would be nice to special-case 
this for small numbers of iterables for this significant speedup.

----------
components: Library (Lib)
files: iter_merge.py
messages: 357631
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Iterable merge performance and inclusion in itertools
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48747/iter_merge.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38938>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to