Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8804939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:44:16+00:00 2026-06-14T01:44:16+00:00

I would like to use this library I found, it’s a pure java port

  • 0

I would like to use this library I found, it’s a pure java port (not a wrapper) of zeromq.
I am trying to test it and while it claims some good numbers, the test I am performing is giving rather poor results and it’s even performed locally (client and serve on the same machine). I’m sure it’s something I am doing wrong. It takes approx. 5 seconds to execute this 10.000 messages loop.

All I did is take the Hello world example and removed pause and sysouts. Here is the code:

The Server:

package guide;

import org.jeromq.ZMQ;

public class hwserver{
    public static void main(String[] args) throws Exception{

        //  Prepare our context and socket
        ZMQ.Context context = ZMQ.context(1);
        ZMQ.Socket socket = context.socket(ZMQ.REP);

        System.out.println("Binding hello world server");
        socket.bind ("tcp://*:5555");        

        while (true) {                  
            byte[] reply = socket.recv(0);
            String requestString = "Hello" ;
            byte[] request = requestString.getBytes();              
            socket.send(request, 0);            
        }              
    }
}

The Client:

package guide;

import org.jeromq.ZMQ;

public class hwclient{
    public static void main(String[] args){
        ZMQ.Context context = ZMQ.context(1);
        ZMQ.Socket socket = context.socket(ZMQ.REQ);
        socket.connect ("tcp://localhost:5555");

        System.out.println("Connecting to hello world server");

        long start = System.currentTimeMillis();
        for(int request_nbr = 0; request_nbr != 10_000; request_nbr++) {
            String requestString = "Hello" ;
            byte[] request = requestString.getBytes();           
            socket.send(request, 0);
            byte[] reply = socket.recv(0);           
        }
        long end = System.currentTimeMillis();
        System.out.println(end-start);
        socket.close();
        context.term();
    }
}

Is is possible to fix this code and get some decent numbers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:44:17+00:00Added an answer on June 14, 2026 at 1:44 am

    You’re doing round-trip request-reply, and this will be just as slow using the C++ libzmq. You will only get fast performance on JeroQM, ZeroMQ, or any I/O when you do streaming.

    Round-tripping is slow due to how I/O and TCP work. On libzmq we can do about 20K messages/second using round-tripping, and 8M/sec using streaming. Streaming has additional optimizations like batching which you can’t do with round-trip request-reply.

    For a throughput performance test, send 10M messages from node 1 to node 2, then send back a single ACK when you get them. Time that on ZeroMQ and on JeroMQ, you should see around 3x difference in speed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found a tab bar library that I would like to use, but
I would like to use this script https://github.com/jeromeetienne/jquery-qrcode (or is there even a better
So, I would like to use this magic find function in my CakePHP 2.0
I would like to change this: // use appropiate lang.xx.php file according to the
I would like to use the Guice in my remote servlet but encountered this
I know this is very basic. I would like to use jQuery to change
I'm stumped by this seemingly trivial problem... I would like to use python to
Instead of app-id@appspot.com or any@app-id.appspot.com I would like to use any@own-domain.tld. can this be
I would like to do something like this i.e., use wild card characters in
This is really just for my own use: I would like to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.