-
Notifications
You must be signed in to change notification settings - Fork 9
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 a tiny bytes::Bytes like implementation #590
Conversation
a69e24b
to
2670283
Compare
BenchmarksComparisonBenchmark execution time: 2024-08-26 11:56:50 Comparing candidate commit 80b0502 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 50 metrics, 2 unstable metrics. CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
BaselineOmitted due to size. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #590 +/- ##
==========================================
+ Coverage 72.71% 72.89% +0.17%
==========================================
Files 241 243 +2
Lines 34427 34638 +211
==========================================
+ Hits 25033 25248 +215
+ Misses 9394 9390 -4
|
2670283
to
b63856b
Compare
} | ||
|
||
impl hash::Hash for Bytes { | ||
// TODO should we cache the hash since we know the bytes are immutable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we can do that. I suppose the overhead in size is minimal a couple bytes, which are likely anyway within padding (the struct is 32 bytes, and system allocator will give you 16 byte aligned memory...)
5ed7be7
to
91212ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple non-blocking comments but LGTM!
e97ee36
to
bb014cd
Compare
bb014cd
to
80b0502
Compare
This is the PR for the |
What does this PR do?
Adds a tiny
bytes::Bytes
like implementation for having multiple byte slices pointing into the same slice.Motivation
The implementation in
bytes::Bytes
does not allow us to use the mapped memory types in theipc
crate, and implementing support for such types in the original crate is a not an option, since it is non trivial and there is a large amount of functionality that doesn't map well to the mapped memory.Additional Notes
Jira ticket: APMS-1330
How to test the change?
There are tests.