dep-protobuf/java/core
Protobuf Team Bot cfb934ad48 Optimize Java Protobuf packed varint counting using SWAR bitwise operations.
Implements 64-bit SWAR chunking via ByteBuffer on non-Android devices, falling back to a scalar countdown loop on Android devices. Sub-8 byte inputs bypass 64-bit chunking and fall through to scalar counting.

### JMH Microbenchmark Results (VarintCountingBenchmark)

| Payload Length | Scalar Baseline | SWAR (ByteBuffer) | Speedup |
| :--- | :--- | :--- | :--- |
| 1 B | 1.78 ns/op | 1.91 ns/op | 1.0x (parity) |
| 4 B | 3.75 ns/op | 3.65 ns/op | 1.0x (parity) |
| 8 B | 6.19 ns/op | 3.44 ns/op | 1.8x faster |
| 16 B | 9.93 ns/op | 4.00 ns/op | 2.5x faster |
| 32 B | 18.58 ns/op | 5.06 ns/op | 3.7x faster |
| 64 B | 35.50 ns/op | 7.51 ns/op | 4.7x faster |
| 128 B | 74.66 ns/op | 10.92 ns/op | 6.8x faster |
| 1024 B | 641.02 ns/op | 75.63 ns/op | 8.5x faster |

PiperOrigin-RevId: 966557820
2026-08-18 06:29:53 -07:00
..
src Optimize Java Protobuf packed varint counting using SWAR bitwise operations. 2026-08-18 06:29:53 -07:00
BUILD.bazel Move initialization of descriptor out of the generated file outer class to avoid circular static initialization issue (e.g. https://github.com/protocolbuffers/protobuf/issues/29012). 2026-08-14 11:23:22 -07:00
generate-sources-build.xml Move java_features.proto to java/core/srce/main/resources 2024-03-25 18:01:21 -07:00
generate-test-sources-build.xml fix(java): fixup test codegen for maven build (#16176) 2024-03-15 19:33:32 -07:00
pom_template.xml Add $ back for osgi header 2023-03-09 17:08:04 +00:00