Skip to content

Conversation

@AlexanderSher
Copy link
Contributor

@AlexanderSher AlexanderSher commented Feb 3, 2023

https://github.com/Azure/azure-sdk-for-net/ repo is updated to C# 11, so now we can use UTF-8 string literals. As @chunyu3 has found, utf8 spans give us 30% performance boost in serialization/deserialization comparing to strings.

Copy link
Member

@archerzz archerzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just wonder if we could update CodeWriter to append u8 to all string literals.

@AlexanderSher
Copy link
Contributor Author

LGTM. Just wonder if we could update CodeWriter to append u8 to all string literals.

No. We can append u8 only where there is matching method signature. E.g., we can't create diagnostic scope with ReadOnlySpan<byte> instead of string. Same with headers - there is no overload of System.Net.Http.Headers.HttpHeaders.TryAddWithoutValidation that accepts ReadOnlySpan<byte>.

@archerzz archerzz merged commit 8bb3405 into Azure:feature/v3 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants