-
Notifications
You must be signed in to change notification settings - Fork 779
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
add PyBackedStr
and PyBackedBytes
#3802
Conversation
CodSpeed Performance ReportMerging #3802 will degrade performances by 20.41%Comparing Summary
Benchmarks breakdown
|
Thank you, this is exactly the kind of code I have used and I see elsewhere for zero-copy of python bytes. What remains to be done in this PR? (I care more about bytes than strings, so would be happy to see this without the UTF8 encode) |
3e9054a
to
419ccb3
Compare
Split from #3708
cc @adamreichold this is inspired by #3784 (comment)
I didn't really want to think too hard about a generic
T
for this type, instead I wanted to just introduce two special cases which should be able to replace&str
orCow<u8>
. These types might end up being temporary just until we can add the second lifetime toFromPyObject
, or maybe we learn from these and refine further later.This depends on #3801 to compile.