numinnex commented on PR #2840:
URL: https://github.com/apache/iggy/pull/2840#issuecomment-3981051647

   Hi, thanks for the contribution.
   
   I am pretty sure a simpler solution to that problem would be to provide the 
`Iterator` with a size hint, this should give compiler enough information to 
generate code identical to yours. You can try doing that instead, here is 
example of that optimization being applied for an `Vec<T>`: 
https://godbolt.org/z/4erhYsxsG
   
   The clue is those two lines
   ```asm
     mov rdi, qword ptr [rbx + 8]
     mov rbx, qword ptr [rdi + 8*rax - 8] // Load the ptr + (len - 1)
     ```


-- 
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