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

   Stacked on #41814 (`perf/dofn-output-receivers`, which stacks on #41813 
`perf/windowed-values`).
   
   Eliminates per-element context, receiver, iterator, and `Instant` 
allocations in `SimpleDoFnRunner`:
   
   - Reuses a single `DoFnProcessContext` instance across `@ProcessElement` 
invocations (clearing `elem` and `namespace` in `finally`, with fail-fast 
reentrancy checks).
   - Has `DoFnProcessContext` implement `OutputBuilderSupplier` directly and 
caches `DirectOutputReceiver` (main output), `outputRowReceiver`, and 
`CachedMultiOutputReceiver` (with identity-cached fast paths for the main tag 
and sole extra output tag).
   - Uses `WindowedValues.singleWindowOrNull()` to skip `explodeWindows()` and 
`Iterables.getOnlyElement()` on single-window elements, and avoids 
OpenTelemetry `Scope` allocation when context is `null` or already active.
   - Caches `allowedTimestampSkew` and validates timestamps with primitive 
`long` arithmetic on the fast path, and short-circuits `outputWindowedValue` 
tag validation on `tag == mainOutputTag`.
   - Adds comprehensive unit tests in `SimpleDoFnRunnerTest` covering context 
reuse/reentrancy/exception cleanup, multi-output/row/direct receivers, 
timestamp skew boundaries, empty-window preservation, and OpenTelemetry context 
propagation.
   
   *(Replaces fork-based #41809 to use native GitHub stacked PRs.)*
   


-- 
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]

Reply via email to