This allows moving most of the tree logic into the .cc instead of having it duplicated on each template instantiation.
This reduces code size of the cold paths, making the hot paths more inlineable.
Make the iterator base completely untyped now that the tree fallback is untyped. More code duplication reduction, and it will allow further improvements on MapField in followup changes.
Move clearing logic to the .cc and optimize it. Having a single copy of it allows adding more logic to it without bloating the template instantiations:
- The map destructor will no longer reset the table before deleting it. That was wasted work.
- Use prefetching to load the nodes ahead of time. Even for trivially destructible nodes we need to read the `next` pointer.
- Start the clearing on index_of_first_non_null_ instead of 0.
- Check for arena==nullptr only once for the whole call instead of once per element.
PiperOrigin-RevId: 532595044
Hello! I'm looking to reserve an option for a project I'm calling proto-telemetry. It will create open-telemetry compatible functions that add attributes to a span. Once this is accepted I'll update the project to use the reserved option number.
Thanks so much!
Closes#12758
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12758 from clly:proto-telemetry a8b38762d7
PiperOrigin-RevId: 532305028
This turns the constexpr constructors into templates to silence errors when constexpr isn't valid. We are also switching to 12.2 for GCC/cmake tests to prevent regressions (9.5 and 13.1 are already tested by GCC/bazel tests).
Fixes#12807
PiperOrigin-RevId: 532258101
Formerly, they had their own fast path. Now they share the chunked processing of all fields. This makes chunked processing more effective as an optimization and also eliminates replicated code for repeated fields.
PiperOrigin-RevId: 532224517
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@jtattermuschCloses#12174
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12174 from JamesNK:jamesnk/remove-regex 9d065a3a71
PiperOrigin-RevId: 532210203