There's a potential solution https://github.com/ros2/rosidl/pull/769 for speeding up the build. That might be a good solution or some other one such that the message generation phase goes faster and isn't noticable when building.