BewareMyPower commented on PR #309: URL: https://github.com/apache/pulsar-client-cpp/pull/309#issuecomment-1697089822
This PR is based on https://github.com/apache/pulsar-client-cpp/pull/308, please review #308 first. 3.3.0, the `SharedBuffer::allocate` takes 5.47% CPU in `sendAsync`. <img width="663" alt="image" src="https://github.com/apache/pulsar-client-cpp/assets/18204803/029cfd41-9414-41cd-a287-499ed33a6dfd"> Now, it only takes 1.07% CPU in `createOpSendMsg`: <img width="1244" alt="image" src="https://github.com/apache/pulsar-client-cpp/assets/18204803/2faed895-7d9b-4f0a-9ab8-761237a0557b"> The throughput improvement. (batch-size: 1000, max-batch-publish-delay-in-ms: 1) In this case, `batchMessageAndSend` happens most in the batch timer callback. 3.3.0: ``` 2023-08-29 09:16:23.578 INFO [140065621355136] PerfProducer:415 | Throughput produced: 78904.9 msg/s --- 616.444 Mbit/s --- Lat avg: 4.19447 ms -- Lat 99pct: 12.3828 ms 2023-08-29 09:16:43.578 INFO [140065621355136] PerfProducer:415 | Throughput produced: 78045.6 msg/s --- 609.732 Mbit/s --- Lat avg: 4.05874 ms -- Lat 99pct: 5.81648 ms 2023-08-29 09:17:03.578 INFO [140065621355136] PerfProducer:415 | Throughput produced: 78022.9 msg/s --- 609.554 Mbit/s --- Lat avg: 4.09393 ms -- Lat 99pct: 7.35203 ms 2023-08-29 09:17:23.578 INFO [140065621355136] PerfProducer:415 | Throughput produced: 78186.4 msg/s --- 610.831 Mbit/s --- Lat avg: 4.1141 ms -- Lat 99pct: 6.19954 ms ``` After this patch: ``` 2023-08-29 09:19:47.382 INFO [140459705907968] PerfProducer:415 | Throughput produced: 79756.1 msg/s --- 623.095 Mbit/s --- Lat avg: 4.15424 ms -- Lat 99pct: 11.4696 ms 2023-08-29 09:20:07.382 INFO [140459705907968] PerfProducer:415 | Throughput produced: 79218.1 msg/s --- 618.891 Mbit/s --- Lat avg: 4.03885 ms -- Lat 99pct: 7.21177 ms 2023-08-29 09:20:27.383 INFO [140459705907968] PerfProducer:415 | Throughput produced: 79229.6 msg/s --- 618.982 Mbit/s --- Lat avg: 4.05724 ms -- Lat 99pct: 8.21727 ms ``` -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org