[C#] Replace regex that validates descriptor names#12174
[C#] Replace regex that validates descriptor names#12174JamesNK wants to merge 3 commits intoprotocolbuffers:mainfrom
Conversation
jskeet
left a comment
There was a problem hiding this comment.
Definitely happy with the overall aim - a few nits.
|
All feedback applied. |
|
Is this waiting on more reviews? I just want to make sure it doesn't get left behind. For context, this change saves 1 MB from .NET Native gRPC client and server apps. I'd love to show off the smallest gRPC apps possible in demos 😄 |
|
Thanks for the prod - I'll chase it up. |
|
@deannagarcia: I think your approval (or at least, someone actually on the Protobuf team) is required before this can proceed. |
|
This missed 3.23.0. Could it be merged now to make it into the next protobuf release? |
|
@JamesNK: Aargh, sorry that this fell through the cracks. |
|
Sorry this fell through, working to get it in now. |
832909d to
9d065a3
Compare
This PR replaces the descriptor name validation regex with a validation method. This change allows the `System.Text.RegularExpressions` engine to be trimmed away in published apps that do standard protobuf serialization. There are some other usages of `Regex` in Google.Protobuf, but they in `JsonParser`. They are only included in a published app if `JsonParser` is used. Another benefit is a slightly faster app startup time. The removed regex was compiled, which has a high-ish fixed cost. cc @jskeet @jtattermusch Closes #12174 COPYBARA_INTEGRATE_REVIEW=#12174 from JamesNK:jamesnk/remove-regex 9d065a3 PiperOrigin-RevId: 532210203
|
@JamesNK: This went out in 3.23.1 :) |
|
Nice. Thanks! |
|
Hi there, This is the only change I made. |
|
from 3.23 to 3.23.1 |
|
@robertodalmonte: Please file a new issue in https://github.com/grpc/grpc-dotnet with more details - it's not appropriate to use a closed PR to report an issue, even if the issue was caused by the change. I'd also strongly recommend that in the new issue, you give more detail than "it stops". I expect there's an exception being thrown somewhere - please look for that and give full details of it in the issue. |
|
Thanks for your suggestion, I will follow it. |
This PR replaces the descriptor name validation regex with a validation method. This change allows the
System.Text.RegularExpressionsengine to be trimmed away in published apps that do standard protobuf serialization.There are some other usages of
Regexin Google.Protobuf, but they inJsonParser. They are only included in a published app ifJsonParseris used.Another benefit is a slightly faster app startup time. The removed regex was compiled, which has a high-ish fixed cost.
cc @jskeet @jtattermusch