-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BytesMut::freeze is not zero-cost #401
Comments
It looks like the original |
@Jasper-Bekkers out of interest, how you get this trace? Is there a way do nearly same on Linux? |
It's profiled with Superluminal Profiler; https://superluminal.eu I don't think it supports Linux yet. |
By looking at it this comes from calling That again means This is all fixable. However a tricky question is whether people are all ok with unused memory in the |
After thinking a bit more about it: I think we can solve this easily by adding an additional |
Did this ever end up getting implemented, and if so, should we close this issue? |
If
self.kind() == KIND_VEC
is true,freeze
ends up callingvec.into()
which appears to not be zero-cost at all, and ends up doing a huge memcpy somewhere in the bowels ofVec
The text was updated successfully, but these errors were encountered: