Don't mark a dependency as used just because it defines a package that's used, since many files can define the same package.
PiperOrigin-RevId: 533184254
Fixes#5139
Previously the fix https://github.com/protocolbuffers/protobuf/pull/5247 has removed unnecessary cast to Builder in generated Java code, and the current PR is doing a similar one for Java lite code.
After this PR, both Java and Java lite code won't have an unnecessary cast to Builder, thus #5139 will be fixed.
This change simply removed those casts to Builder for 2 methods, and the reason it will work is:
DEFAULT_INSTANCE.createBuilder method is defined in the superclass, and the return value is a generic value which is exactly the Builder class passed in.
Closes#10781
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/10781 from 1e0ng:main e8f9c982fe
PiperOrigin-RevId: 532813058
Hi,
When benchmarking proto_benchmark from fleetbench on an AArch64 target we found that clang is able to vectorize these functions and they offer better performance than the scalar alternative.
I ran //src/google/protobuf:arena_unittest on aarch64-none-linux-gnu. Should I run any other tests? Also protobuf used to have its own set of benchmarks, but I can't find these when I query all targets with bazel. Let me know if you'd like me to run anything else, I couldn't find instructions on what the full test run is.
Closes#11102
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11102 from avieira-arm:main 5552410a25
PiperOrigin-RevId: 532779004
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