Apologize for the long delay.
We have been trying out a few ideas for reducing build time on our side, but unfortunately, none has produced noticeable improvements in our CI/CD environment.
We have also devoted energy to investigating the root cause of increasing build time. We add a few custom examples to ROS 2/example Galactic to amplify impacts related to subscription. The examples are then built against every single Rclcpp commit since Galactic while keeping the rest of the Packages Rolling.
We can easily make out 3 distinct jumps at, 2e4c97a, 679fb2b, and d8e1aed and a noticeable drop at 9c1c989 even with the noise in the data.
Among the three jumps, 2e4c97a’s impact is on an arguably different magnitude increasing the build time by ~18%. 2e4c97a happens to be the commit for Type Adaption which is one area we originally suspected in our original post. The drop at 9c1c989 corresponds to moving event callback binding to PublisherBase and SubscriptionBase. Both cases confirm that templates have a lot to do with build time changes. However, we can also see that build time trends upward over time with the rest of the commits. We have also tried building the examples against Galactic packages and the average build time is approximated 36s. It indicates that packages besides Rclcpp also contribute to the build time increase.
With our production CI/CD pipeline building internal projects, we see even more dramatic increases. In the worst-case scenario, we see build time increased by 40%. It shows that certain hierarchies can be impacted even more than the examples used above.
With the new data, we think
- Compilation metrics should be established and tracked for ROS-2 packages, especially the ones consuming ROS-2 core.
- Add build-time investigation and improvement to the roadmap for the next ROS-2 release. As demonstrated in the chart above, there are certainly some refactoring directions that can help reduce the increased build time.
