[issue16394] Improving tee() memory footprint

2012-11-03 Thread Carsten Milkau
New submission from Carsten Milkau: The memory footprint of itertools.tee can be reduced substantially by using a shared buffer for the child iterators (see sample code). If local queues are desired for efficient threading support, they can be combined with a global queue, allowing

[issue16394] Improving tee() memory footprint

2012-11-03 Thread Carsten Milkau
Carsten Milkau added the comment: No. The sample code is a demonstration how to do it, it's by no means a full-fledged patch. The drawback of the current implementation is that if you tee n-fold, and then advance one of the iterators m times, it fills n queues with m references each

[issue16394] Improving tee() memory footprint

2012-11-03 Thread Carsten Milkau
Carsten Milkau added the comment: Oh great! Then I can use it as-is. How about reassigning the issue to documentation (for clarifying the inefficiency warning)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16394

[issue16394] Improving tee() memory footprint

2012-11-03 Thread Carsten Milkau
Changes by Carsten Milkau chat.n...@arcor.de: -- assignee: - docs@python components: +Documentation -Library (Lib) nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16394