Slower performance of ROS2 Galactic with local build vs pre-built binaries
I've got pre-built binaries for ROS2 Galactic installed on my Ubuntu 20.04 machine. No issues with getting that going -- the demo_nodes_cpp & demo_nodes_py test examples work as expected.
Checking into performance as part of some other investigations I'm doing, I compiled this package from Github: https://github.com/berndpfrommer/ros2...
Running that with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run ros2_issues publisher_node --ros-args -p num_elements:=50000 -p rate:=1000
, I see the following performance numbers:
[INFO] [1650574539.746257732] [test_publisher]: pub rate: 31.25
[INFO] [1650574540.757245605] [test_publisher]: pub rate: 31.65
[INFO] [1650574541.775833948] [test_publisher]: pub rate: 31.42
Further, I'm able to build ROS2 Galactic Geochelone from source following the instructions here: https://docs.ros.org/en/galactic/Inst...
No issues with that either. Running the demo_nodes_cpp and demo_nodes_py test examples work as expected.
If I source my local build of ROS2, however, and run the "ros2_issues" package as above, however, I get the following performance numbers which are worse than with the pre-built binaries:
[INFO] [1650572322.229327451] [test_publisher]: pub rate: 10.90
[INFO] [1650572323.231439150] [test_publisher]: pub rate: 10.98
[INFO] [1650572324.236953146] [test_publisher]: pub rate: 10.94
Am I missing optimization issues with my local ROS2 build? Is something else at play?
Thanks!
TLDR: Building ROS2 Galactic locally vs using pre-built binaries is giving me markedly different results with a package that demonstrates ros2 performance issues. Any ideas what may be causing the difference? Is my local build missing optimization settings for compilation maybe?