Skip to content
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

[WIP] Improve C# serialization performance - ArrayValueWriter #5828

Conversation

WilliamWhispell
Copy link
Contributor

this fixes issue #5822

This applies the same style optimizations that are done in WriteString, handling the "common case".
I need to sort out indentation to match the project. I'm opening this up for initial feedback. I've moved incrementing the position member variable to outside of the loops as I saw it generated less assembly and appeared to perform better on Release builds for my profiling.

I'm seeing about 100% speed improvements for repeated fields on primitives, so I'd be curious if others see the same too. These optimizations are applied only if the entire array fits within the buffer, otherwise performance should be the same. This optimization should be covered by the existing unit tests which test varying buffer sizes, but the test data could be added to providing longer repeated fields.

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.

None yet

2 participants