Commit 6e6bff1
committed
Deque as a Growable Ring Buffer
Inspired by Rust's VecDeque, we have rewritten Python's
collections.deque to use a growable ring buffer implementation. This
change improves memory efficiency and performance for various operations,
including indexing and slicing.
Specifically, indexing is now O(1), and slicing is supported at all in O(k)
time, where k is the number of elements in the slice.1 parent 9b0179f commit 6e6bff1
File tree
6 files changed
+1243
-928
lines changed- Doc
- library
- whatsnew
- Lib
- collections
- test
- Modules
- clinic
6 files changed
+1243
-928
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
| 482 | + | |
| 483 | + | |
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
| |||
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
594 | | - | |
595 | | - | |
596 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
597 | 600 | | |
598 | 601 | | |
599 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2193 | 2193 | | |
2194 | 2194 | | |
2195 | 2195 | | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
2196 | 2205 | | |
2197 | 2206 | | |
2198 | 2207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
0 commit comments