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

[Proposal]: UTF-8 Literal Pattern Matching Support #6161

Open
1 of 4 tasks
333fred opened this issue May 25, 2022 · 3 comments
Open
1 of 4 tasks

[Proposal]: UTF-8 Literal Pattern Matching Support #6161

333fred opened this issue May 25, 2022 · 3 comments
Assignees
Labels
Needs Approved Specification This issue needs an LDM-approved specification Proposal champion
Milestone

Comments

@333fred
Copy link
Member

333fred commented May 25, 2022

UTF-8 Literal Pattern Matching Support

  • Proposed
  • Prototype: Not Started
  • Implementation: Not Started
  • Specification: Not Started

The LDM looked at the concept and approved it in theory, but it needs an approved specification. This is in the Any Time milestone, so we'd accept a specification from a community member.

Original discussion: #6036

Design Meetings

@333fred 333fred added Proposal champion Needs Approved Specification This issue needs an LDM-approved specification labels May 25, 2022
@333fred 333fred added this to the Any Time milestone May 25, 2022
@333fred 333fred self-assigned this May 25, 2022
@neon-sunset
Copy link

@333fred I would like to try writing a specification for this proposal (will be able to start next week).

@333fred
Copy link
Member Author

333fred commented Aug 2, 2023

Go for it, though I will be out until late August.

@bill-poole
Copy link

It would be very useful if C# also provided the ability to specify a UTF-8 string (e.g., "MyUtf8String"u8) as a constant, which would then allow such constants to be used in the respective case statements of a switch statement. That would then have the potential to allow developers to more easily build much more efficient JsonConverter<T> implementations because at present, each JSON property is found/identified through a chain of if/else-if statements using Utf8JsonReader.ValueTextEquals calls.

If the switch statement performance improvements for switching string options implemented in .NET 8 were to be made available for UTF-8 strings and then employed in JsonConverter<T> implementations, we could see a significant performance boost in JSON deserialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Approved Specification This issue needs an LDM-approved specification Proposal champion
Projects
None yet
Development

No branches or pull requests

3 participants