Skip to content

Conversation

danburkert
Copy link
Contributor

Removes a call to UninitMut indexing, which can panic, from
Vec::<u8>::bytes_mut(). I came across this while looking at a
performance issue encountered after moving to bytes 0.6. This change
makes a microbenchmark in prost slightly faster, although there's
still a big delta between 0.5 and 0.6. See danburkert/prost#381.

Removes a call to UninitMut indexing, which can panic, from
`Vec::<u8>::bytes_mut()`.  I came across this while looking at a
performance issue encountered after moving to bytes 0.6. This change
makes a microbenchmark in `prost` slightly faster, although there's
still a big delta between 0.5 and 0.6. See danburkert/prost#381.
@danburkert
Copy link
Contributor Author

Added a second commit which adds an #[inline] for Vec::put_slice, which closed most of the remaining perf difference between 0.5 and 0.6. Will have another PR to add inlines to UninitSlice to close out the rest.

Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@taiki-e
Copy link
Member

taiki-e commented Apr 10, 2021

@danburkert Could you resolve merge conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants