Create a new account
(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.)
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 http://github.com/tsee/ZeroMQ-Perl [github.com]
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: 20000average latency: 32.631 [us]
With my Perl client (C server), I get:
message size: 10000 [B]roundtrip count: 20000average 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.
Get More Comments