Commit ae0edaf
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 ae0edaf
1 file changed
+20
-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 | + | |
118 | 134 | | |
119 | 135 | | |
120 | 136 | | |
| |||
521 | 537 | | |
522 | 538 | | |
523 | 539 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
528 | 543 | | |
529 | | - | |
530 | | - | |
531 | | - | |
| 544 | + | |
532 | 545 | | |
533 | 546 | | |
534 | 547 | | |
| |||
0 commit comments