-
Notifications
You must be signed in to change notification settings - Fork 14
feat: introduce writeTo(byte[]) #614
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
Conversation
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
JUnit Test Report 77 files ±0 77 suites ±0 3m 30s ⏱️ -27s Results for commit 47c1b51. ± Comparison against base commit 28f0a82. This pull request removes 8 and adds 7 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Integration Test Report 405 files +1 405 suites +1 18m 2s ⏱️ +51s Results for commit 47c1b51. ± Comparison against base commit 28f0a82. This pull request removes 3 and adds 4 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
pbj-core/pbj-grpc-helidon/src/test/java/com/hedera/pbj/grpc/helidon/PbjTest.java
Show resolved
Hide resolved
pbj-core/pbj-runtime/src/main/java/com/hedera/pbj/runtime/Utf8Tools.java
Show resolved
Hide resolved
pbj-core/pbj-runtime/src/main/java/com/hedera/pbj/runtime/Utf8Tools.java
Outdated
Show resolved
Hide resolved
...ava/com/hedera/pbj/compiler/impl/generators/protobuf/CodecWriteByteArrayMethodGenerator.java
Show resolved
Hide resolved
...ava/com/hedera/pbj/compiler/impl/generators/protobuf/CodecWriteByteArrayMethodGenerator.java
Show resolved
Hide resolved
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
...ava/com/hedera/pbj/compiler/impl/generators/protobuf/CodecWriteByteArrayMethodGenerator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Description:
This is a part of an original proof of concept PR at #612 .
Introducing an ability to write protobuf data to pre-existing byte arrays. This allows client code to reuse the same byte array for multiple write operations and avoid allocating new arrays or buffers for this purpose. This also enables certain optimizations, such as a more efficient writing of varint data types where the write operation can start directly from a byte at a larger index, and then descend gradually writing to lesser significant bytes.
In the new
ProtoArrayWriterTools.java, the current PR already implements the optimized version of varint writing. There'll be a follow-up PR focusing on varints specifically that would add benchmarks, but they are outside of scope of this particular PR.Related issue(s):
Fixes #613
Notes for reviewer:
All tests should pass. This is a new API, so no existing code is affected.
Checklist