TCP Latency of Netty and Vert.x TCP - baoyingwang/LibrariesEvaluation GitHub Wiki
Introduction
vert.x tcp is based on netty. It is more easy to use.
CoralReactor has a performance report for the performance between CoralReactor and Netty. http://www.coralblocks.com/index.php/coralreactor-vs-netty-performance-comparison/
How it is tested
- client: send fixed side( or deliminated as another test) message to server, including T1: sending nano time.
- server: echo the message back to client, with the T2: sending nano time of server side.
- client: received server ack, record the T3: now.
- net message #1 -> #2 ->#3, until reach the expected total message number(e.g. 1000,000)
- calculate average latency
note: it is via loopback, since server and cient are on same laptop. note: warmup is not executed for the vertx test(I did not get time on it, yet) note: the source code for netty is copied directly from http://www.coralblocks.com/index.php/coralreactor-vs-netty-performance-comparison/, with minor changes because 1) it cannot work because of netty interface on HandlerAdapter 2) no sourcecode for the benchmark and systemutil .
test hardware env:
- win 7 64bit
- java 1.8.0_111 64bit
- cpu: intel i7 6600 2.60 GHZ
test result
vertx.tcp - fixed message size(1024)
client msg size:1024 Connected! vert.x-eventloop-thread-0: downBenchresults=avg latency(us):18.77189821 speed(perf second): 26871.61 took:37.214 seconds total:1000000 vert.x-eventloop-thread-0: e2eBenchresults=avg latency(us):37.18224482 speed(perf second): 26871.61 took:37.214 seconds total:1000000
vertx.tcp - delimited message by "\nXX\n". The message size is also 1024, but the size is NOT used to identify a message.
client msg size:1024 Connected! vert.x-eventloop-thread-0: downBenchresults=avg latency(us):26.02039289 speed(perf second): 19283.43 took:51.858 seconds total:1000000 vert.x-eventloop-thread-0: e2eBenchresults=avg latency(us):51.81635955 speed(perf second): 19283.06 took:51.859 seconds total:1000000
netty - fixed size(1024)
results=avg latency(us):17.99206678 speed(perf second): 34136.68 took:29.294 seconds total:1000000 it includes a warmup(provided by default from corereactor test source code).
netty - delimitor
not get time to do that.