Skip to content

Revert "perf: replace ArrayList consumer wheel with LongMap for O(1) keyed removal (#3063)"#3113

Closed
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:revert/broadcast-hub-longmap-3063
Closed

Revert "perf: replace ArrayList consumer wheel with LongMap for O(1) keyed removal (#3063)"#3113
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:revert/broadcast-hub-longmap-3063

Conversation

@He-Pin

@He-Pin He-Pin commented Jun 20, 2026

Copy link
Copy Markdown
Member

Motivation

PR #3063 replaced the BroadcastHub consumer wheel's ArrayList with scala.collection.mutable.LongMap for O(1) keyed removal. The PR description credited akkadotnet/akka.net#8264 as its inspiration.

Although the Pekko implementation was written from scratch (using LongMap rather than Dictionary/HashMap), there is concern that the original idea and design framing — replacing the per-slot consumer collection with a keyed map for O(1) removal — came from reading the akka.net PR description rather than being derived independently from the Pekko codebase. Until the licensing and provenance question is fully resolved, revert the change so it can be re-done cleanly from scratch, with independent motivation and design.

Modification

Revert the squash-merged commit 28d61c53684dcd22302560220698d74a7c5da789 (PR #3063):

The post-#3072 private field style (no private[this]) is preserved — only the LongMap data-structure change from #3063 is undone.

Result

BroadcastHub behavior returns to its state before #3063. No public API or binary compatibility change vs. the current main branch — only the internal LongMap-based wheel introduced by #3063 is undone. The optimization can be re-done from scratch in a follow-up PR once the provenance question is settled.

Tests

  • sbt "stream/compile" → success
  • sbt "stream-tests/Test/testOnly *HubSpec" → 48 passed, 0 failed
  • sbt "stream/mimaReportBinaryIssues" → no issues
  • git diff --check origin/main..HEAD → clean

References

Refs #3063, Refs akkadotnet/akka.net#8264 — provenance review pending.

…keyed removal (apache#3063)"

Motivation:
PR apache#3063 was inspired by akkadotnet/akka.net#8264. Although the Pekko
implementation was written independently (using scala.collection.mutable
.LongMap instead of Dictionary/HashMap), there is concern that the
original idea and design framing came from reading the akka.net PR
description rather than being derived independently from the Pekko
codebase. Until the licensing and provenance question is resolved,
revert the change so it can be re-done cleanly from scratch.

Modification:
Revert commit 28d61c5 ("perf: replace ArrayList consumer wheel with
LongMap for O(1) keyed removal (apache#3063)"). The consumer wheel returns
from Array[LongMap[Consumer]] back to Array[java.util.ArrayList[Consumer]]
with ArrayList.removeIf for keyed lookup. BroadcastHubBenchRunner and
the high-consumer HubSpec tests added by that PR are removed; the
JMH benchmark is restored to its prior configuration.

Result:
BroadcastHub behavior returns to its state before apache#3063. No public API
or binary compatibility change vs. the current main branch; only the
internal LongMap-based wheel introduced by apache#3063 is undone.

Tests:
- sbt "stream/compile" -> success
- sbt "stream-tests/Test/testOnly *HubSpec" -> 48 passed, 0 failed
- sbt "stream/mimaReportBinaryIssues" -> no issues
- git diff --check origin/main..HEAD -> clean

References:
Refs apache#3063, Refs akkadotnet/akka.net#8264 - provenance review pending
@He-Pin

He-Pin commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

@pjfanning let's merge this to reduce the maintain burden.

@He-Pin

He-Pin commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

He is fine

@He-Pin He-Pin closed this Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant