zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.72k stars 2.36k forks source link

Significant performance decrease compared to 4.1.5 #1947

Closed AxelVoitier closed 8 years ago

AxelVoitier commented 8 years ago

Hello,

I noticed a drop of performance between 4.1.5 and the current 4.2.0 HEAD.

I ran the performance tests on the two versions with 1MB message size (to clearly see it, but it seems to happen as well with 100B messages, with about x2 difference factor in throughtput) repeated 1000 times. The local and remote are on the same physical machines, but in two separate docker containers (I can provide all the dockerfiles & co. if you have trouble reproducing it).

Version 4.1.5 throughput test: local_thr tcp://*:7000 1048576 1000 remote_thr tcp://local:7000 1048576 1000

ZMQ Version: 4.1.5
message size: 1048576 [B]
message count: 1000
mean throughput: 1614 [msg/s]
mean throughput: 13539.213 [Mb/s]

real    0m0.954s
user    0m0.064s
sys 0m0.620s

Version 4.2.0 throughput test: local_thr tcp://*:7000 1048576 1000 remote_thr tcp://local:7000 1048576 1000

ZMQ Version: 4.2.0
message size: 1048576 [B]
message count: 1000
mean throughput: 227 [msg/s]
mean throughput: 1904.214 [Mb/s]

real    0m4.693s
user    0m0.144s
sys 0m3.916s

Version 4.1.5 latency test: local_lat tcp://*:7000 1048576 1000 remote_lat tcp://local:7000 1048576 1000

ZMQ Version: 4.1.5

real    0m2.598s
user    0m0.068s
sys 0m0.800s
message size: 1048576 [B]
roundtrip count: 1000
average latency: 646.348 [us]

Version 4.2.0 latency test: local_lat tcp://*:7000 1048576 1000 remote_lat tcp://local:7000 1048576 1000

ZMQ Version: 4.2.0

real    0m10.371s
user    0m0.248s
sys 0m5.004s
message size: 1048576 [B]
roundtrip count: 1000
average latency: 4517.717 [us]

I notice this performance drop also in the real application as well as in this application own performance tests (using different socket types than from the zmq perf testers).

Any idea which change could have brought such drop?

Cheers, Axel