-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
[C#] Replace regex that validates descriptor names #12174
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.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 inJsonParser
. They are only included in a published app ifJsonParser
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