ros2_rust icon indicating copy to clipboard operation
ros2_rust copied to clipboard

Add benchmarks for Subscriber and Publisher

Open AlexKaravaev opened this issue 3 years ago • 2 comments

Hi everyone!

It's a PR for #33, however, I don't really know which of the parts of the library should be benchmarked at first, currently I only have written tests for simple publishing and subscribing for simple string and creating of publisher and subscriber instances.

Ideas that I have about what can be benchmarked:

  • Publishing and subscribing with more heavy payload(E.g progressing increase of message size)
  • Message creation

Please feel free to add some ideas

AlexKaravaev avatar Apr 11 '22 11:04 AlexKaravaev

Would benchmarking the creation and sending/receiving of messages with allocated portions (such as Strings) vs trivially-copyable portions (such as i32) be of use?

Another thing that might be good to benchmark are all the various ROS 2 object creation functions: creating nodes, creating contexts, creating publishers, creating subscribers, etc. More for catching performance regressions than anything else. While these functions mostly involve external ROS 2 code, it would give us insight into the health of the external system.

jhdcs avatar Apr 25 '22 11:04 jhdcs

@AlexKaravaev Want to revive this to gather some numbers for sending messages in the same process vs between processes?

We could construct a message, and then time the duration for

  • sending the message
  • receiving the message on the other end, and
  • sending back a very small response (e.g. std_msgs/msg/Empty)

for different message types. See also https://gitlab.com/ApexAI/performance_test

nnmm avatar Sep 28 '22 18:09 nnmm