Commit 19d7c3a
committed
Removed unnecessary intermediate
- Removed unnecessary intermediate `Vec<Bytes>` allocation in HTTP request body preparation
- Directly consume `SegmentedBytes` iterator into stream using `Arc::unwrap_or_clone()`
- Implemented zero-cost `BodyIterator` enum to avoid heap allocation and dynamic dispatch
- Reduces memory overhead and eliminates Vec growth reallocations during request preparationVec<Bytes> allocation in HTTP request body preparation1 parent 1ee21b7 commit 19d7c3a
1 file changed
+32
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
118 | 136 | | |
119 | 137 | | |
120 | 138 | | |
| |||
521 | 539 | | |
522 | 540 | | |
523 | 541 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
528 | 555 | | |
529 | | - | |
530 | | - | |
531 | | - | |
| 556 | + | |
532 | 557 | | |
533 | 558 | | |
534 | 559 | | |
| |||
0 commit comments