Commit 6ccbfe1
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 f4b4c90 commit 6ccbfe1
1 file changed
+32
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
122 | 140 | | |
123 | 141 | | |
124 | 142 | | |
| |||
539 | 557 | | |
540 | 558 | | |
541 | 559 | | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
546 | 573 | | |
547 | | - | |
548 | | - | |
549 | | - | |
| 574 | + | |
550 | 575 | | |
551 | 576 | | |
552 | 577 | | |
| |||
0 commit comments