PyZeROS: a Python-first alternative to `rclpy` over Zenoh

Got some early benchmarks on a strong desktop PC!

Empty String message:

  • pyzeros: 12us
  • AsyncNode: 10us

12 joints JointStates messages:

  • pyzeros: 16us
  • AsyncNode: 22us

Standard deviation is 4us for all

So basically, AsyncNode is slightly lighter, I guess because it’s just a callback, whereas pyzeros has a queue and backpressure system that adds a few more us. And maybe the zenoh-python bindings are a few us slower than the C RMW. Also AsyncNode might be better at handling empty messages, delegating to C, instead of pyzeros that has to create empty python objects and allocate memory.

On non-empty messages, my XCDR1 codec cydr – that is very optimised for Python – makes pyzeros take the lead. But I doubt 8us come from the codec alone, maybe I also do less memory operations than AsyncNode.

PS: the new AsyncNode is insanely fast, just like what I found by using asyncio on my own. Good job to the ROS team, 6x improvement, that’s fantastic.

2 Likes