Skip to content

Conversation

@bigjt-dev
Copy link
Contributor

There are a couple instances where the ByteBuffer's Span property was accessed in a loop.

  • Extracted the use of the property outside of the loop to save a few cpu cycles.

Access to the allocator's internal buffer isn't exposed as a ReadOnlySpan from the ByteBuffer or the FlatBufferBuilder.

  • Added a few convenience functions to access the buffer using a ReadOnlySpan.

There are a few cases where built in Span extensions can be used to run optimized code.

  • Added the use of Span.Fill() and ReadOnlySpan.SequenceCompareTo to replace existing loops.

There are a couple instances where the ByteBuffer's Span property was accessed in a loop.
 + Extracted the use of the property outside of the loop to save a few cpu cycles.

Access to the allocator's internal buffer isn't exposed as a ReadOnlySpan<byte> from the ByteBuffer
or the FlatBufferBuilder.
 + Added a few convenience functions to access the buffer using a ReadOnlySpan<byte>.

There are a few cases where built in Span extensions can be used to run optimized code.
 + Added the use of Span.Fill() and ReadOnlySpan.SequenceCompareTo to replace existing loops.
@google-cla
Copy link

google-cla bot commented May 1, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the c# label May 1, 2025
@bjornharrtell bjornharrtell self-requested a review August 24, 2025 15:13
@bjornharrtell
Copy link
Collaborator

@aardappel consider merge

@aardappel aardappel merged commit 82396fa into google:master Aug 28, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants