[improve][build] Upgrade LightProto to 0.6.1#25332
Conversation
c4527ac to
b866eb6
Compare
Upgrade the LightProto Maven plugin from 0.4 (com.github.splunk.lightproto) to 0.6.1 (io.streamnative.lightproto). Key changes: - Update groupId from com.github.splunk.lightproto to io.streamnative.lightproto - Remove the properties-maven-plugin workaround that was needed to set proto_path and proto_search_strategy system properties, as 0.6.x handles proto resolution natively via the extraProtoPaths configuration - Configure extraProtoPaths for the transaction coordinator module to resolve cross-module proto imports - Update SpotBugs exclusions for generated proto code
b866eb6 to
3706e8b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #25332 +/- ##
============================================
+ Coverage 72.25% 72.76% +0.51%
- Complexity 33963 34254 +291
============================================
Files 1954 1954
Lines 154639 154691 +52
Branches 17698 17700 +2
============================================
+ Hits 111732 112565 +833
+ Misses 33884 33100 -784
- Partials 9023 9026 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
One concern about lightproto 0.6.1 is that the optimized String handling might not be compatible with |
|
Good point. I've enabled issues now. |
|
@lhotari created PR: streamnative/lightproto#1 |
Motivation
Upgrade the LightProto serialization library from 0.4 to 0.6.1. LightProto is used in Pulsar for high-performance, zero-copy serialization of internal protocol buffers (PulsarApi, transaction metadata, delayed message indexes, resource usage).
LightProto 0.6.x highlights
Full release notes: https://github.com/streamnative/lightproto/releases/tag/v0.6.0
Serialization performance overhaul
Unsafe-based serialization, pre-ensureWritable in
writeTo()to eliminate per-field capacity checks, ASCII fast-path for string serialization, native arrays replacingArrayListfor repeated fields, precomputed tag sizes, unrolled VarInt64 decoding, and cached serialized size afterparseFrom.Performance: v0.4 → v0.6
LightProto v0.6 vs Google Protobuf (PulsarAPI)
Proto3 support
Full proto3 syntax support including implicit field presence, packed-by-default repeated fields, and the
optionalkeyword. This opens up the opportunity to standardize more of Pulsar's serialization on LightProto. Currently, Pulsar uses a mix of Google Protobuf (with its higher allocation overhead) and LightProto. With proto3 support, additional proto definitions — such as those used in the client-broker protocol or managed ledger metadata — could be migrated to LightProto, reducing GC pressure and improving throughput in the hot path.New field types & features
map<K, V>fields — complete support for protobuf map fieldsoneoffields — proto2 oneof support with efficient memory layout*Grpc.javawith zero-copy Netty marshallerprotocdescriptor setsChanges in this PR
com.github.splunk.lightprototoio.streamnative.lightprotoproperties-maven-pluginconfiguration that was only needed for the old LightProto's protostuff-based parserextraProtoPathsconfiguration for the transaction coordinator module to resolve cross-module proto imports nativelyDocumentation
doc-not-neededMatching PR in