Repository navigation
Release consumed itertools.tee buffers - #9322
Conversation
Assisted-by: Codex:GPT-6
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Merging this PR will degrade performance by 12.08%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Found while running
more_itertools.triplewiseover a stream of objects.Summary
teevalues in shared blocks and release a block once every copy has advanced past it. Previously, surviving iterators retained the entire input history.Performance
After consuming 20,000 objects with 1 KiB payloads through
more_itertools.triplewise, retained payload falls from 19.5 MiB to 32 KiB on both systems.Windows 11 x64
Debian 13 amd64
Consecutive consumption of the two copies remains slower than main.
AI assistance
Written with Codex (GPT-6), reviewed by a human before submission.
Summary by CodeRabbit
itertools.teenow releases items after all iterator copies have passed them, reducing memory retained during long iterations.teeiterator now raises a clear runtime error.