You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/06/20 13:54:14 UTC
[PR] Revert "perf: replace ArrayList consumer wheel with LongMap for O(1) keyed removal (#3063)" [pekko]
He-Pin opened a new pull request, #3113:
URL: https://github.com/apache/pekko/pull/3113
### 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](https://github.com/akkadotnet/akka.net/pull/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):
- `BroadcastHub` consumer wheel: `Array[LongMap[Consumer]]` back to `Array[java.util.ArrayList[Consumer]]`; keyed lookup uses `ArrayList.removeIf` again.
- `findAndRemoveConsumer`, `addConsumer`, `wakeupIdx`, `onUpstreamFailure`, and the `Advance`/`NeedWakeup` event handlers are restored to their pre-#3063 shape.
- `BroadcastHubBenchRunner` (standalone benchmark runner added by #3063) is removed.
- `BroadcastHubBenchmark` is restored to its prior `@Param` configuration (`64`, `256`) and single `broadcast` method.
- The two high-consumer `HubSpec` tests added by #3063 (`deliver all elements in order to many consumers`, `handle many consumers when some cancel mid-stream`) are removed.
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](https://github.com/akkadotnet/akka.net/pull/8264) — provenance review pending.
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Revert "perf: replace ArrayList consumer wheel with LongMap for O(1) keyed removal (#3063)" [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #3113:
URL: https://github.com/apache/pekko/pull/3113#issuecomment-4759070116
He is fine
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Revert "perf: replace ArrayList consumer wheel with LongMap for O(1) keyed removal (#3063)" [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #3113:
URL: https://github.com/apache/pekko/pull/3113#issuecomment-4758361952
@pjfanning let's merge this to reduce the maintain burden.
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Revert "perf: replace ArrayList consumer wheel with LongMap for O(1) keyed removal (#3063)" [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #3113: Revert "perf: replace ArrayList consumer wheel with LongMap for O(1) keyed removal (#3063)"
URL: https://github.com/apache/pekko/pull/3113
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org