My team has a ROS2 humble docker image we use for development. It contains our dependencies along with a source installation of Humble targeting Ubuntu arm64 architecture on a Nvidia Jetson device. Building our source code takes a very long time (up to an hour for a clean build). We are currently using the following commands in a fresh terminal inside the docker container for a clean build.
source /opt/ros2/humble/install/setup.bash && colcon build --merge-install
If the code was already built then running above still results in a 1min 9s build time which is still quite long for a no-change build. I feel this is unreasonably long as our ROS1 noetic builds using catkin took a small fraction of this time.
I have seen discussions online about ros2 subscribers eating up some build time, but even so this still seems excessive. And, that still doesn't explain the 1m9s build time for a no-change build. So I feel this may be colcon or maybe ament specific rather than just slow c++ build times. It's worth noting the python packages take about 15-20s each as well.
Are there any best practices for reducing build times or recommendations for profiling colcon to identify the bottleneck?