acrites opened a new pull request, #41655:
URL: https://github.com/apache/beam/pull/41655

   Avoid allocating a cloned `Encoding[]` array twice per decoded element in 
`PaneInfo.PaneInfoCoder.Encoding.fromTag(byte)`.
   
   ### Summary
   - Cache `Encoding.values()` once in a `private static final Encoding[] 
VALUES` field inside `PaneInfo.PaneInfoCoder.Encoding`.
   - Reuse the cached `VALUES` array and computed `index` in `fromTag(byte)`.
   - Expand `PaneInfoTest` to cover `Encoding.ONE_INDEX` across non-`EARLY` 
timings and add `testDecodeInvalidEncodingThrowsCoderException` for invalid 
encoding tag bytes.
   
   ### Testing
   - `./gradlew :sdks:java:core:spotlessCheck :sdks:java:core:checkstyleMain 
:sdks:java:core:checkstyleTest :sdks:java:core:spotbugsMain 
:sdks:java:core:test --tests 
"org.apache.beam.sdk.transforms.windowing.PaneInfoTest" --tests 
"org.apache.beam.sdk.util.WindowedValueTest"`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] [Java] Cache Encoding.val... acrites (via GitHub) via github

Reply via email to