There is "Double Read(String name)" method, and it takes 50~60ms to call
Read() 1000 times.

I made two message queues that are basically a wrapper around that method.

(Java Client)DEALER <-----> ROUTER <-----> Read()


I expected the following code to take within 70ms to read 1000 times, but
it took 250~410ms.

long start=getTimeInMillis()
for(int i=0; i<1000; ++i)
  reader.send(name+i)

for(int i=0; i<1000; ++i)
  reader.recv()
long end=getTimeInMillis()

System.out.println("Milliseconds taken to read 1000 times : " + (end-start))

I utilized asynchronous send and recv, but I guess it was slow because
ROUTER used a strict requst-reply pattern.

I read zguide, and "Figure 38 - Detail of Asynchronous Server" inspired me
to make a variant.

Java Client <----> DEALER <-----> ROUTER|Proxy|DEALER <----->
DEALER <-----> Read()
It's simply an asynchronous server with only one worker.

Would it bring about the speedup that I wish for?

Please join this thread.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to