Measure a completed exchange
Download native-benchmark.py. On your Linux machine, install pyzmq==27.3.0 and run the script in a terminal.
python native-benchmark.py --count 1000 --trials 5
What the timer includes
One Python process creates a request socket and a reply socket. They connect inside that process using inproc. The timer starts after setup. Each exchange sends an eight-byte payload, receives it at the server, sends it back and checks that the client receives the same bytes.
Read the results
Check completed in each entry of trials first. It should equal --count. Use median_seconds to compare the middle trial time with the same exchange count. Record the machine, Python and ZeroMQ versions when you compare results.
This benchmark measures a local exchange in one process. It runs outside the browser. Timing a production service also requires its network, workload and storage costs.