Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PublisherAsBlockingIterable LinkedBlockingQueue -> LinkedTransferQueue (
#2386) Motivation: LinkedBlockingQueue goes through LockSupport park and unpark methods which can incur relatively expensive context switching if the EventLoop thread has to unpark an application thread. This has been shown to be a bottleneck as throughput increases. Modifications: - Use LinkedTransferQueue which does a `Thread.yield()` before parking on the consumer thread. This may use more CPU on the consumer thread but the assumption is there will be many more application threads than EventLoop threads and we want to minimize producer costs. Results: LinkedTransferQueue ``` Running 30s test @ http://localhost:8080/medium, using 'ServiceTalkGrpcBlockingClientStrAgg' client 1024 threads and 1024 connections Thread Stats Avg Stdev Max +/- Stdev Latency - - - - Req/Sec 0.01k - 0.01k - 290977 requests in 30s Requests/sec: 9699.23 Transfer/sec: - OK: 290977 KO: 0 ``` LinkedBlockingQueue ``` Running 30s test @ http://localhost:8080/medium, using 'ServiceTalkGrpcBlockingClientStrAgg' client 1024 threads and 1024 connections Thread Stats Avg Stdev Max +/- Stdev Latency - - - - Req/Sec 0.01k - 0.01k - 256778 requests in 30s Requests/sec: 8559.27 Transfer/sec: - OK: 256778 KO: 0 ```
- Loading branch information