Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Mark Leighton Fisher (4252)

Mark Leighton Fisher
  (email not shown publicly)

I am a Systems Engineer at Regenstrief Institute []. I also own Fisher's Creek Consulting [].
Friday June 11, 2010
03:07 PM

ZeroMQ: Fastest. Messaging. Ever.

[ #40390 ]
ZeroMQ (or 0MQ) appears to be a fast (8M+ messages/second), Open Source message-passing engine. I don't have a use for it now, but it does look interesting.

(There is no Perl interface for ZeroMQ, but it sounds (without my actually researching the task) like it shouldn't be too hard to clone the Ruby FFI interface for use with Perl.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Isn't wrapping it in plain XS the easier and faster route for anything that goes beyond simple types (which are easy to do with FFI)?

  • Not using FFI, as noted in my previous reply.

    See []

    Documentation doesn't exist yet. My time for this is pretty much exhausted, so people will have to go by the C++ docs of 0MQ2 itself. If somebody was willing to write a little documentation and maybe write some more tests, we could a) release to CPAN and b) advertise this to 0MQ as a Perl interface for inclusion in their list. I think the documentation should be doable in 1-2 hours.

    • Also did some quick timing.

      The basic latency test looks promising. For the native C version from 0MQ (running on the client and server on the same dual-core machine via tcp), I get:

      message size: 10000 [B]
      roundtrip count: 20000
      average latency: 32.631 [us]

      With my Perl client (C server), I get:

      message size: 10000 [B]
      roundtrip count: 20000
      average latency: 40.767 [us]

      I'd say that's pretty damn awesome!

      • PS: the message size and roundtrip count are arbitrary. Even for small messages, the Perl wrapper isn't that much slower.

        Furthemore, Perl server + Perl client comes in at 48.237 [us] latency, which is seems to indicate that wrapping 0MQ with Perl incurs a penalty of 8us each way. Not bad, could be better.

        A Message size of 1 instead of the 10k yields 30us latency for Perl vs Perl.