lhotari commented on a change in pull request #12456:
URL: https://github.com/apache/pulsar/pull/12456#discussion_r734864734
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java
##########
@@ -269,7 +269,7 @@ private void receiveMessageFromConsumer(ConsumerImpl<T>
consumer) {
// recursion and stack overflow
internalPinnedExecutor.execute(() ->
receiveMessageFromConsumer(consumer));
Review comment:
Since the `thenAcceptAsync` now makes this code run on the
internalPinnedExecutor, this extra scheduling to the internalPinnedExecutor
should be removed. There isn't a risk of the stack growing infinitely since
there is no direct recursive call chain.
This change improved the throughput performance by about 8% in a simple
local benchmark.
```bash
# create topic with 10 partitions
./bin/pulsar-admin topics create-partitioned-topic -p 10 parttest
# run producer (a lot of small messages to stress test the logic)
./bin/pulsar-perf produce -ioThreads 4 -s 10 -o 6000 -p 200000 -r 350000
parttest
# run consumer (in another terminal)
./bin/pulsar-perf consume -q 6000 -p 200000 parttest
```
Throughput performance went from 290k msgs/s to about 315k msgs/s.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]