hubcio commented on PR #2925:
URL: https://github.com/apache/iggy/pull/2925#issuecomment-4062894483

   **[critical] `payload.clone()` on every message in all 4 batch mode loops**
   `lib.rs:572, 727, 799, 880`
   
   `consume()` takes `messages: Vec<ConsumedMessage>` by value, but all send 
methods iterate via `&messages` and `.clone()` each payload. for 
`Payload::Raw(Vec<u8>)`, `FlatBuffer(Vec<u8>)`, and `Json(OwnedValue)` this is 
a full heap copy per message. fix is trivial -- change to `for message in 
messages` (consuming iterator) since `payload_to_json()` and `try_into_vec()` 
already take `Payload` by value.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to