Skip to content

Add allocation-free WindowedValues fast paths and optimize OutputRece… - #41538

Open
reuvenlax wants to merge 4 commits into
apache:masterfrom
reuvenlax:perf/windowed-values-output-receivers
Open

reuvenlax wants to merge 4 commits into
apache:masterfrom
reuvenlax:perf/windowed-values-output-receivers

Conversation

@reuvenlax

@reuvenlax reuvenlax commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Microbenchmarks show significant improvement to OutputReceiver (4.3x), about 10% speedup to fullWindowedValue encode/decode, and 20% improvement to fullWindowedValueCoderByteSizeObserver.

This is part of a sequence of PRs that improve performance overall e2e Dataflow jobs by 25%

…ivers / FnApiDoFnRunner

- WindowedValues: add ofWithCurrentContext(...) and builder(template, value) helpers,
  omit redundant OpenTelemetry Context.root() references, and add SingleWindowedValue
  fast paths in FullWindowedValueCoder encode/decode/registerByteSizeObserver.
- OutputBuilderSupplier / OutputBuilderSuppliers / DoFnOutputReceivers: add direct
  build(value) and buildWithTimestamp(value, ts) methods avoiding intermediate Builder
  and lambda allocations on every emitted element.
- FnApiDoFnRunner: use WindowedValues.ofWithCurrentContext(...) and builder(elem, val)
  in output receivers.
- Add unit tests in WindowedValueTest and JMH benchmarks in OutputReceiverBenchmark.
@github-actions github-actions Bot added java core size/l L: 250-999 lines changed labels Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers (or comment /summarize-failures for a summary of the failing checks).

@github-actions github-actions Bot added runners size/xl XL: >=1000 lines changed and removed size/l L: 250-999 lines changed labels Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant