The GitHub Actions job "Binary Compatibility" on 
pekko.git/optimize-internal-concat-value-presented has succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
c5a4e58af856e2947b585fb769edb81039b51a16 / He-Pin <[email protected]>
optimize: extend internalConcat dispatch for value-presented sources

Motivation:
`FlowOps#internalConcat` previously had only one fast-path: `SingleSource`
on the right-hand side was rerouted through the lightweight `SingleConcat`
stage instead of the general two-port `Concat[U](2, detached)` fan-in graph
(which materializes the whole substream plus a detacher buffer). All other
value-presented sources (`IterableSource`, `IteratorSource`, `RangeSource`,
`RepeatSource`, `JavaStreamSource`, `FutureSource`, `FailedSource`) still
took the heavy `concatGraph` path even though their data is already in
memory or trivially producible — the fan-in machinery and substream
materialization were pure overhead. Heavy `concat` users (pekko-http and
others) carry that cost on every materialization.

Modification:
Add four small specialized `GraphStage[FlowShape[E, E]]` siblings of
`SingleConcat`, each passing through elements while upstream is alive and
draining its captured value-presented payload on `onUpstreamFinish`:

  - `IterableConcat[E](createIterator)` — emits via `emitMultiple`, covers
    `IterableSource`, `IteratorSource`, `RangeSource`, `JavaStreamSource`.
  - `RepeatConcat[E](elem)` — swaps `OutHandler` so each `onPull` pushes
    `elem`, covers `RepeatSource`.
  - `FailedConcat[E](failure)` — calls `failStage(failure)`, covers
    `FailedSource`.
  - `FutureConcat[E](future)` — emits/fails for completed futures, otherwise
    swaps `OutHandler` (to avoid pulling the now-closed `in` port) and
    registers an async callback that resolves once the future completes.

`internalConcat` is extended to dispatch via
`TraversalBuilder.getValuePresentedSource` and pattern-match the eight
value-presented source types (existing `SingleSource` path is preserved).
The `detached` flag is irrelevant for these stages — the right-hand data is
already present, so the one-element pre-fetch buffer that `detached=true`
provides has nothing to fetch (matching `SingleConcat`'s precedent).

Result:
For the eight value-presented source types, `concat` and `concatLazy` no
longer pay for substream materialization or the two-port fan-in graph.
Observable behavior is unchanged for all other sources, which still take the
existing `concatGraph` path. Eleven directional tests added to
`AbstractFlowConcatSpec` cover each new dispatch and assert (a) values
delivered correctly and (b) zero substream materialization for value-
presented sources. All `*FlowConcatSpec`, `*FlowConcatLazySpec`,
`*FlowConcatAllSpec`, `*FlowConcatAllLazySpec`, and `*GraphConcatSpec` pass.
MiMa is clean (all new stages are `private[pekko]` / `InternalApi`).

Report URL: https://github.com/apache/pekko/actions/runs/26012599577

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to