Commit 3f80a2a
committed
perf: use deque for async response chunk iteration
AsyncResponse.__anext__() replays cached chunks via list.pop(0) when
the response is already done, which is O(n) per removal. Switch to
collections.deque with popleft() for O(1).1 parent 6b84a0d commit 3f80a2a
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
1386 | 1387 | | |
1387 | 1388 | | |
1388 | 1389 | | |
1389 | | - | |
| 1390 | + | |
1390 | 1391 | | |
1391 | 1392 | | |
1392 | 1393 | | |
1393 | 1394 | | |
1394 | 1395 | | |
1395 | | - | |
| 1396 | + | |
1396 | 1397 | | |
1397 | 1398 | | |
1398 | 1399 | | |
| |||
0 commit comments