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

Use more UTF-8 string literals #40

Merged
merged 5 commits into from
Mar 20, 2024
Merged

Conversation

PaulusParssinen
Copy link
Contributor

@PaulusParssinen PaulusParssinen commented Mar 19, 2024

This PR

  • replaced many of the Encoding.ASCII.GetBytes([constant string}) calls with the newish UTF-8 string literals syntax where applicable.
  • used RVA statics to store some of the cosntant data directly in .data -section where possible but there's still a lot of opportunities for that.
  • Updated RespWriteUtils.WriteBulkString and RespWriteUtils.WriteDirect to take ReadOnlySpan<byte>s instead of arrays
    • This allowed me to remove unnecessary Memory<byte> overloads which should pretty much never be parameters in sync paths. We can just pass the Memory<byte>.Span to the write methods instead.

@vazois vazois self-assigned this Mar 20, 2024
@vazois vazois merged commit 77464b0 into microsoft:main Mar 20, 2024
7 checks passed
@PaulusParssinen PaulusParssinen deleted the u8-literals branch March 20, 2024 17:01
@github-actions github-actions bot locked and limited conversation to collaborators May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants