-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd REQ->recv Socket Performance #53
Comments
Isn't this just the usual Julia thing where the first time you call a function it takes some time to be compiled? |
That's what my first thought was, but while the first request is slow (I'd imagine from compilation) it's the second call here that is even slower: 10ms, 100ms, <1ms, <1ms .... |
@JeffBezanson, is there something in the memory subsystem that could cause a large latency like this in mid-computation, even though |
Looking at memory allocation along with the times:
So memory allocation seems to be the problem, and the fact that it is showing up in the second time through recv, and not the first makes me wonder if this is a ZMQ.jl problem rather than normal Julia compilation. And I also don't understand why unrolling the loop makes things worse for the first time through and while leaving the second slow. But other than being odd, I don't know if this is sufficiently worse than normal Julia initialization time to warrant further investigation, so I'd be okay if the maintainers decided to close this issue. |
I've run a few simple ping/pong benchmarks and noticed some weird performance behavior of the REQ socket. Comparing performance to Python's pyzmq, the server (REP socket) performance is about the same, but for the Julia client, the request of the REQ socket reliably takes >100 milliseconds, whereas the first takes about 10ms, and all others are <1ms:
I've accounted here for garbage collection and whether the server is written in Julia or Python. The Python client has all requests handled in <1ms:
I further narrowed this extra time to the
recv
of the REQ socket by more narrowly bracketing my tic()/toc(), but things look remarkably similar in the code (both libraries are thin wrappings over zmq_msg_recv). And I didn't know where else to look.The text was updated successfully, but these errors were encountered: