* Before the cell is started the RepointableActorRef queue the messages
(both system and non-system messages) into a queue. System messages
are inserted right before the last non-system message by iterating
the queue, i.e. becomes slow when there are many system messages already
enqueued.
* This is a problem for pools with many routees.
* The fix is to keep system messages in a separate queue
JMH benchmark before:
[info] Benchmark (size) Mode Cnt Score Error Units
[info] RouterPoolCreationBenchmark.testCreation 1000 ss 300 13204.048 ± 3081.576 us/op
[info] RouterPoolCreationBenchmark.testCreation 2000 ss 300 41939.524 ± 6178.087 us/op
[info] RouterPoolCreationBenchmark.testCreation 3000 ss 300 70752.881 ± 4344.992 us/op
[info] RouterPoolCreationBenchmark.testCreation 4000 ss 300 120620.885 ± 3296.342 us/op
JMH benchmark after:
[info] Benchmark (size) Mode Cnt Score Error Units
[info] RouterPoolCreationBenchmark.testCreation 1000 ss 300 7738.721 ± 1806.297 us/op
[info] RouterPoolCreationBenchmark.testCreation 2000 ss 300 15497.588 ± 4532.852 us/op
[info] RouterPoolCreationBenchmark.testCreation 3000 ss 300 28704.005 ± 6322.458 us/op
[info] RouterPoolCreationBenchmark.testCreation 4000 ss 300 37783.516 ± 6778.437 us/op
fully drain sysmsgQueue when swap cell
|
||
|---|---|---|
| .. | ||
| src/main/scala/akka | ||
| build.sbt | ||