Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moveit_core: Remove unnecessary rclcpp.hpp includes #1333

Merged
merged 3 commits into from
Jun 14, 2022

Conversation

JafarAbdi
Copy link
Member

Description

Using https://github.com/aras-p/ClangBuildAnalyzer to profile the compile time for the whole codebase I found out rclcpp.hpp is one of the most expensive headers: https://gist.github.com/JafarAbdi/965b23666d4aeca92990554629b45644

So this PR removes unnecessary rclcpp.hpp includes from moveit_core which result in ~55s reduction in compile time (without parallel build)

Before:

Processing all files and saving to 'output_file'...
  done in 0.3s. Run 'ClangBuildAnalyzer --analyze output_file' to analyze it.
Analyzing build trace from 'output_file'...
**** Time summary:
Compilation (138 times):
  Parsing (frontend):          532.8 s
  Codegen & opts (backend):     85.6 s

**** Files that took longest to parse (compiler frontend):
 14592 ms: build/moveit_core//planning_scene/CMakeFiles/moveit_planning_scene.dir/src/planning_scene.cpp.o
 14385 ms: build/moveit_core//kinematics_metrics/CMakeFiles/moveit_kinematics_metrics.dir/src/kinematics_metrics.cpp.o
 14122 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/robot_state.cpp.o
 13638 ms: build/moveit_core//kinematic_constraints/CMakeFiles/moveit_kinematic_constraints.dir/src/kinematic_constraint.cpp.o
 12290 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_env_distance_field.cpp.o
 11680 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_env_hybrid.cpp.o
 10709 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_common_distance_field.cpp.o
 10539 ms: build/moveit_core//constraint_samplers/CMakeFiles/moveit_constraint_samplers.dir/src/default_constraint_samplers.cpp.o
 10451 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/conversions.cpp.o
 10269 ms: build/moveit_core//robot_trajectory/CMakeFiles/moveit_robot_trajectory.dir/src/robot_trajectory.cpp.o

**** Files that took longest to codegen (compiler backend):
  7590 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/robot_state.cpp.o
  6501 ms: build/moveit_core//utils/CMakeFiles/moveit_test_utils.dir/src/robot_model_test_utils.cpp.o
  6421 ms: build/moveit_core//kinematics_metrics/CMakeFiles/moveit_kinematics_metrics.dir/src/kinematics_metrics.cpp.o
  5667 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_env_distance_field.cpp.o
  4517 ms: build/moveit_core//planning_scene/CMakeFiles/moveit_planning_scene.dir/src/planning_scene.cpp.o
  3953 ms: build/moveit_core//robot_model/CMakeFiles/moveit_robot_model.dir/src/robot_model.cpp.o
  3887 ms: build/moveit_core//kinematic_constraints/CMakeFiles/moveit_kinematic_constraints.dir/src/kinematic_constraint.cpp.o
  3058 ms: build/moveit_core//kinematic_constraints/CMakeFiles/moveit_kinematic_constraints.dir/src/utils.cpp.o
  2552 ms: build/moveit_core//collision_detection/CMakeFiles/moveit_collision_detection.dir/src/collision_plugin_cache.cpp.o
  2373 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/conversions.cpp.o

**** Templates that took longest to instantiate:
 29752 ms: Eigen::Transform<double, 3, 1, 0>::computeRotationScaling<Eigen::Mat... (56 times, avg 531 ms)
 15057 ms: Eigen::JacobiSVD<Eigen::Matrix<double, 3, 3, 0>, 2>::JacobiSVD (56 times, avg 268 ms)
 14986 ms: Eigen::JacobiSVD<Eigen::Matrix<double, 3, 3, 0>, 2>::compute (56 times, avg 267 ms)
  8990 ms: Eigen::Transform<double, 3, 1, 0>::operator* (41 times, avg 219 ms)
  8986 ms: Eigen::internal::transform_transform_product_impl<Eigen::Transform<d... (40 times, avg 224 ms)
  7082 ms: rclcpp::Subscription<rcl_interfaces::msg::ParameterEvent_<std::alloc... (55 times, avg 128 ms)
  6149 ms: rclcpp::AnySubscriptionCallback<rcl_interfaces::msg::ParameterEvent_... (55 times, avg 111 ms)
  6086 ms: rclcpp::Client<rcl_interfaces::srv::GetParameters> (55 times, avg 110 ms)
  6074 ms: rclcpp::Client<rcl_interfaces::srv::DescribeParameters> (55 times, avg 110 ms)
  6059 ms: std::unordered_map<long, std::pair<std::chrono::time_point<std::chro... (55 times, avg 110 ms)
  6048 ms: std::unordered_map<long, std::pair<std::chrono::time_point<std::chro... (55 times, avg 109 ms)
  6021 ms: std::variant<std::function<void (const rcl_interfaces::msg::Paramete... (55 times, avg 109 ms)
  5991 ms: std::_Hashtable<long, std::pair<const long, std::pair<std::chrono::t... (55 times, avg 108 ms)
  5955 ms: std::_Hashtable<long, std::pair<const long, std::pair<std::chrono::t... (55 times, avg 108 ms)
  5884 ms: rclcpp::Client<rcl_interfaces::srv::SetParametersAtomically> (55 times, avg 106 ms)
  5860 ms: std::unordered_map<long, std::pair<std::chrono::time_point<std::chro... (55 times, avg 106 ms)
  5856 ms: rclcpp::Client<rcl_interfaces::srv::SetParameters> (55 times, avg 106 ms)
  5842 ms: rclcpp::Client<rcl_interfaces::srv::ListParameters> (55 times, avg 106 ms)
  5832 ms: std::unordered_map<long, std::pair<std::chrono::time_point<std::chro... (55 times, avg 106 ms)
  5811 ms: std::unordered_map<long, std::pair<std::chrono::time_point<std::chro... (55 times, avg 105 ms)
  5803 ms: std::_Hashtable<long, std::pair<const long, std::pair<std::chrono::t... (55 times, avg 105 ms)
  5775 ms: std::_Hashtable<long, std::pair<const long, std::pair<std::chrono::t... (55 times, avg 105 ms)
  5751 ms: rclcpp::Client<rcl_interfaces::srv::GetParameterTypes> (55 times, avg 104 ms)
  5749 ms: std::_Hashtable<long, std::pair<const long, std::pair<std::chrono::t... (55 times, avg 104 ms)
  5728 ms: std::unordered_map<long, std::pair<std::chrono::time_point<std::chro... (55 times, avg 104 ms)
  5672 ms: std::_Hashtable<long, std::pair<const long, std::pair<std::chrono::t... (55 times, avg 103 ms)
  5651 ms: std::__detail::_Insert<long, std::pair<const long, std::pair<std::ch... (55 times, avg 102 ms)
  5639 ms: std::__detail::_Insert_base<long, std::pair<const long, std::pair<st... (55 times, avg 102 ms)
  5575 ms: std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_... (55 times, avg 101 ms)
  5525 ms: std::__detail::_Insert<long, std::pair<const long, std::pair<std::ch... (55 times, avg 100 ms)

**** Template sets that took longest to instantiate:
 57755 ms: Eigen::MatrixBase<$> (5234 times, avg 11 ms)
 43786 ms: std::unordered_map<$> (879 times, avg 49 ms)
 43662 ms: std::variant<$> (726 times, avg 60 ms)
 43485 ms: std::_Hashtable<$> (1123 times, avg 38 ms)
 38942 ms: std::__detail::__variant::_Variant_base<$> (726 times, avg 53 ms)
 38561 ms: Eigen::internal::call_assignment_no_alias<$> (1703 times, avg 22 ms)
 37637 ms: Eigen::internal::Assignment<$>::run (1676 times, avg 22 ms)
 36942 ms: std::pair<$> (2339 times, avg 15 ms)
 36538 ms: std::__detail::_Insert<$> (1002 times, avg 36 ms)
 36354 ms: std::__detail::_Insert_base<$> (1001 times, avg 36 ms)
 35495 ms: rclcpp::Client<$> (330 times, avg 107 ms)
 35433 ms: std::__detail::_Hashtable_alloc<$> (1001 times, avg 35 ms)
 34655 ms: Eigen::DenseBase<$> (5437 times, avg 6 ms)
 34259 ms: std::__detail::_Hash_node<$> (934 times, avg 36 ms)
 34226 ms: std::__detail::_Hash_node_value<$> (934 times, avg 36 ms)
 34191 ms: std::__detail::_Hash_node_value_base<$> (934 times, avg 36 ms)
 34141 ms: __gnu_cxx::__aligned_buffer<$> (934 times, avg 36 ms)
 29752 ms: Eigen::Transform<$>::computeRotationScaling<$> (56 times, avg 531 ms)
 27975 ms: Eigen::internal::call_assignment<$> (1253 times, avg 22 ms)
 26902 ms: Eigen::Matrix<$>::Matrix<$> (716 times, avg 37 ms)
 26783 ms: Eigen::internal::call_dense_assignment_loop<$> (1749 times, avg 15 ms)
 25370 ms: Eigen::PlainObjectBase<$>::_set_noalias<$> (558 times, avg 45 ms)
 24441 ms: std::tuple<$> (2730 times, avg 8 ms)
 24255 ms: std::unique_ptr<$> (2335 times, avg 10 ms)
 23730 ms: Eigen::internal::generic_product_impl<$>::evalTo<$> (339 times, avg 70 ms)
 23590 ms: std::is_trivially_destructible<$> (3515 times, avg 6 ms)
 20559 ms: std::__uniq_ptr_data<$> (2335 times, avg 8 ms)
 20317 ms: std::__uniq_ptr_impl<$> (2335 times, avg 8 ms)
 20252 ms: std::__and_<$> (18870 times, avg 1 ms)
 19870 ms: Eigen::JacobiSVD<$>::JacobiSVD (58 times, avg 342 ms)

**** Functions that took longest to compile:
   227 ms: kinematic_constraints::collectConstraints(std::shared_ptr<rclcpp::No... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematic_constraints/src/utils.cpp)
   189 ms: constraint_samplers::ConstraintSamplerManager::selectDefaultSampler(... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/constraint_samplers/src/constraint_sampler_manager.cpp)
   134 ms: collision_detection::CollisionEnvDistanceField::generateDistanceFiel... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_distance_field/src/collision_env_distance_field.cpp)
   122 ms: moveit::core::RobotModel::constructJointModel(urdf::Link const*, srd... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/robot_model.cpp)
   119 ms: boost::re_detail_107400::basic_regex_parser<char, boost::regex_trait... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/utils/src/robot_model_test_utils.cpp)
   114 ms: moveit::core::JointModelGroup::JointModelGroup(std::__cxx11::basic_s... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/joint_model_group.cpp)
    91 ms: trajectory_processing::CircularPathSegment::CircularPathSegment(Eige... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)
    90 ms: moveit::core::(anonymous namespace)::_robotStateMsgToRobotStateHelpe... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/conversions.cpp)
    81 ms: trajectory_processing::IterativeSplineParameterization::computeTimeS... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/iterative_spline_parameterization.cpp)
    80 ms: Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::compu... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_metrics/src/kinematics_metrics.cpp)
    80 ms: collision_detection::CollisionEnvDistanceField::getIntraGroupCollisi... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_distance_field/src/collision_env_distance_field.cpp)
    80 ms: Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::compu... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/robot_state.cpp)
    76 ms: robot_trajectory::RobotTrajectory::getRobotTrajectoryMsg(moveit_msgs... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_trajectory/src/robot_trajectory.cpp)
    72 ms: moveit::core::RobotState::setFromIK(moveit::core::JointModelGroup co... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/robot_state.cpp)
    71 ms: moveit::core::RobotState::setFromIKSubgroups(moveit::core::JointMode... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/robot_state.cpp)
    63 ms: collision_detection::collisionCallback(fcl::CollisionObject<double>*... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection_fcl/src/collision_common.cpp)
    60 ms: collision_detection::CollisionEnvDistanceField::getGroupStateReprese... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_distance_field/src/collision_env_distance_field.cpp)
    59 ms: trajectory_processing::Trajectory::integrateForward(std::__cxx11::li... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)
    58 ms: moveit::core::RobotModelBuilder::addChain(std::__cxx11::basic_string... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/utils/src/robot_model_test_utils.cpp)
    58 ms: Eigen::EigenSolver<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::doCom... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_metrics/src/kinematics_metrics.cpp)
    56 ms: moveit::core::attachedBodiesToAttachedCollisionObjectMsgs(std::vecto... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/conversions.cpp)
    56 ms: Eigen::internal::partial_lu_impl<double, 0, int, -1>::unblocked_lu(E... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_metrics/src/kinematics_metrics.cpp)
    55 ms: boost::re_detail_107400::basic_regex_creator<char, boost::regex_trai... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/utils/src/robot_model_test_utils.cpp)
    55 ms: dynamics_solver::DynamicsSolver::DynamicsSolver(std::shared_ptr<move... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/dynamics_solver/src/dynamics_solver.cpp)
    55 ms: moveit::core::RobotModel::setKinematicsAllocators(std::map<std::__cx... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/robot_model.cpp)
    53 ms: moveit::core::RobotModel::buildJointInfo() (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/robot_model.cpp)
    52 ms: pluginlib::ClassLoader<collision_detection::CollisionPlugin>::getAll... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/src/collision_plugin_cache.cpp)
    52 ms: collision_detection::refineContactNormals(std::shared_ptr<collision_... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/src/collision_octomap_filter.cpp)
    51 ms: trajectory_processing::Path::Path(std::__cxx11::list<Eigen::Matrix<d... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)
    47 ms: trajectory_processing::TimeOptimalTrajectoryGeneration::doTimeParame... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)

**** Function sets that took longest to compile / optimize:
   302 ms: std::_Rb_tree<$>::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_... (53 times, avg 5 ms)
   281 ms: std::vector<$>::_M_default_append(unsigned long) (52 times, avg 5 ms)
   227 ms: kinematic_constraints::collectConstraints(std::shared_ptr<$> const&,... (1 times, avg 227 ms)
   210 ms: std::__shared_ptr<$>::~__shared_ptr() (143 times, avg 1 ms)
   189 ms: constraint_samplers::ConstraintSamplerManager::selectDefaultSampler(... (1 times, avg 189 ms)
   186 ms: std::_Rb_tree_iterator<$> std::_Rb_tree<$>::_M_emplace_hint_unique<$... (62 times, avg 3 ms)
   178 ms: Eigen::JacobiSVD<$>::compute(Eigen::Matrix<$> const&, unsigned int) (3 times, avg 59 ms)
   173 ms: std::vector<$>::~vector() (103 times, avg 1 ms)
   164 ms: std::_Rb_tree<$>::_M_get_insert_unique_pos(std::__cxx11::basic_strin... (57 times, avg 2 ms)
   151 ms: visualization_msgs::msg::Marker_<$>::Marker_(visualization_msgs::msg... (8 times, avg 18 ms)
   134 ms: collision_detection::CollisionEnvDistanceField::generateDistanceFiel... (1 times, avg 134 ms)
   131 ms: std::_Rb_tree<$>::_M_erase(std::_Rb_tree_node<$>*) (108 times, avg 1 ms)
   123 ms: void std::vector<$>::_M_range_insert<$>(__gnu_cxx::__normal_iterator... (11 times, avg 11 ms)
   119 ms: boost::re_detail_107400::basic_regex_parser<$>::parse_perl_extension() (1 times, avg 119 ms)
   114 ms: moveit::core::JointModelGroup::JointModelGroup(std::__cxx11::basic_s... (1 times, avg 114 ms)
   109 ms: void std::vector<$>::_M_realloc_insert<$>(__gnu_cxx::__normal_iterat... (17 times, avg 6 ms)
   100 ms: void std::_Rb_tree<$>::_M_construct_node<$>(std::_Rb_tree_node<$>*, ... (48 times, avg 2 ms)
    98 ms: std::vector<$>::vector(std::vector<$> const&) (28 times, avg 3 ms)
    95 ms: void std::deque<$>::_M_insert_aux<$>(std::_Deque_iterator<$>, std::_... (4 times, avg 23 ms)
    95 ms: non-virtual thunk to boost::wrapexcept<$>::~wrapexcept() (21 times, avg 4 ms)
    93 ms: Eigen::internal::product_triangular_matrix_matrix<$>::run(long, long... (8 times, avg 11 ms)
    92 ms: std::_Rb_tree<$>::find(std::__cxx11::basic_string<$> const&) const (35 times, avg 2 ms)
    91 ms: trajectory_processing::CircularPathSegment::CircularPathSegment(Eige... (1 times, avg 91 ms)
    90 ms: moveit::core::(anonymous namespace)::_robotStateMsgToRobotStateHelpe... (1 times, avg 90 ms)
    87 ms: Eigen::internal::general_matrix_vector_product<$>::run(long, long, E... (6 times, avg 14 ms)
    86 ms: Eigen::internal::dense_assignment_loop<$>::run(Eigen::internal::gene... (11 times, avg 7 ms)
    84 ms: Eigen::ColPivHouseholderQR<$>::computeInPlace() (2 times, avg 42 ms)
    80 ms: collision_detection::CollisionEnvDistanceField::getIntraGroupCollisi... (1 times, avg 80 ms)
    76 ms: robot_trajectory::RobotTrajectory::getRobotTrajectoryMsg(moveit_msgs... (1 times, avg 76 ms)
    76 ms: void Eigen::internal::make_block_householder_triangular_factor<$>(Ei... (2 times, avg 38 ms)

*** Expensive headers:
197327 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/include/moveit/robot_model/robot_model.h (included 46 times, avg 4289 ms), included via:
  robot_model.cpp.o  (5510 ms)
  constraint_sampler_tools.cpp.o constraint_sampler_tools.h constraint_sampler.h planning_scene.h  (5486 ms)
  conversions.cpp.o conversions.h robot_state.h  (5475 ms)
  butterworth_filter.cpp.o butterworth_filter.h  (5474 ms)
  default_constraint_samplers.cpp.o default_constraint_samplers.h constraint_sampler.h planning_scene.h  (5470 ms)
  iterative_time_parameterization.cpp.o iterative_time_parameterization.h robot_trajectory.h robot_state.h  (5469 ms)
  ...

175227 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/include/moveit/robot_model/joint_model_group.h (included 47 times, avg 3728 ms), included via:
  iterative_spline_parameterization.cpp.o iterative_spline_parameterization.h robot_trajectory.h robot_state.h robot_model.h  (4742 ms)
  iterative_time_parameterization.cpp.o iterative_time_parameterization.h robot_trajectory.h robot_state.h robot_model.h  (4741 ms)
  planning_response.cpp.o planning_response.h robot_trajectory.h robot_state.h robot_model.h  (4679 ms)
  robot_model.cpp.o robot_model.h  (4578 ms)
  butterworth_filter.cpp.o butterworth_filter.h robot_model.h  (4563 ms)
  constraint_sampler_tools.cpp.o constraint_sampler_tools.h constraint_sampler.h planning_scene.h robot_model.h  (4559 ms)
  ...

150512 ms: /opt/ros/rolling/include/rclcpp/rclcpp/rclcpp.hpp (included 55 times, avg 2736 ms), included via:
  collision_common_distance_field.cpp.o  (3630 ms)
  robot_model_test_utils.cpp.o  (3608 ms)
  smoothing_base_class.cpp.o smoothing_base_class.h  (3541 ms)
  exceptions.cpp.o  (3329 ms)
  kinematics_base.cpp.o kinematics_base.h  (2944 ms)
  collision_plugin_cache.cpp.o collision_plugin_cache.h collision_plugin.h collision_env.h collision_matrix.h collision_common.h robot_model.h joint_model_group.h kinematics_base.h  (2893 ms)
  ...

131416 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h (included 47 times, avg 2796 ms), included via:
  kinematics_base.cpp.o  (4043 ms)
  iterative_spline_parameterization.cpp.o iterative_spline_parameterization.h robot_trajectory.h robot_state.h robot_model.h joint_model_group.h  (3233 ms)
  iterative_time_parameterization.cpp.o iterative_time_parameterization.h robot_trajectory.h robot_state.h robot_model.h joint_model_group.h  (3195 ms)
  planning_response.cpp.o planning_response.h robot_trajectory.h robot_state.h robot_model.h joint_model_group.h  (3172 ms)
  dynamics_solver.cpp.o dynamics_solver.h robot_state.h robot_model.h joint_model_group.h  (3165 ms)
  ruckig_traj_smoothing.cpp.o ruckig_traj_smoothing.h robot_trajectory.h robot_state.h robot_model.h joint_model_group.h  (3152 ms)
  ...

90385 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/include/moveit/collision_detection/collision_common.h (included 29 times, avg 3116 ms), included via:
  collision_plugin_cache.cpp.o collision_plugin_cache.h collision_plugin.h collision_env.h collision_matrix.h  (5659 ms)
  collision_matrix.cpp.o collision_matrix.h  (5641 ms)
  collision_common.cpp.o  (5603 ms)
  collision_env.cpp.o collision_env.h collision_matrix.h  (5544 ms)
  collision_env_bullet.cpp.o collision_env_bullet.h collision_env.h collision_matrix.h  (5523 ms)
  collision_octomap_filter.cpp.o  (5497 ms)
  ...

81110 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/include/moveit/robot_state/robot_state.h (included 33 times, avg 2457 ms), included via:
  iterative_spline_parameterization.cpp.o iterative_spline_parameterization.h robot_trajectory.h  (5820 ms)
  iterative_time_parameterization.cpp.o iterative_time_parameterization.h robot_trajectory.h  (5814 ms)
  conversions.cpp.o conversions.h  (5811 ms)
  robot_state.cpp.o  (5723 ms)
  planning_response.cpp.o planning_response.h robot_trajectory.h  (5694 ms)
  kinematics_metrics.cpp.o kinematics_metrics.h  (5675 ms)
  ...

53355 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/include/moveit/collision_detection/collision_matrix.h (included 26 times, avg 2052 ms), included via:
  collision_plugin_cache.cpp.o collision_plugin_cache.h collision_plugin.h collision_env.h  (5708 ms)
  collision_matrix.cpp.o  (5692 ms)
  collision_env.cpp.o collision_env.h  (5593 ms)
  collision_env_bullet.cpp.o collision_env_bullet.h collision_env.h  (5576 ms)
  collision_env_allvalid.cpp.o collision_env_allvalid.h collision_env.h  (5521 ms)
  collision_env_hybrid.cpp.o collision_detector_allocator_hybrid.h collision_detector_allocator.h collision_env.h  (5484 ms)
  ...

50797 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/include/moveit/collision_detection/collision_env.h (included 20 times, avg 2539 ms), included via:
  collision_plugin_cache.cpp.o collision_plugin_cache.h collision_plugin.h  (6078 ms)
  collision_env.cpp.o  (5977 ms)
  collision_env_bullet.cpp.o collision_env_bullet.h  (5948 ms)
  collision_env_allvalid.cpp.o collision_env_allvalid.h  (5923 ms)
  collision_env_hybrid.cpp.o collision_detector_allocator_hybrid.h collision_detector_allocator.h  (5846 ms)
  collision_env_fcl.cpp.o collision_env_fcl.h  (5549 ms)
  ...

45790 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_trajectory/include/moveit/robot_trajectory/robot_trajectory.h (included 19 times, avg 2410 ms), included via:
  iterative_time_parameterization.cpp.o iterative_time_parameterization.h  (6286 ms)
  iterative_spline_parameterization.cpp.o iterative_spline_parameterization.h  (6273 ms)
  planning_response.cpp.o planning_response.h  (6146 ms)
  robot_trajectory.cpp.o  (6034 ms)
  planning_interface.cpp.o planning_interface.h planning_response.h  (5044 ms)
  planning_request_adapter.cpp.o planning_request_adapter.h planning_interface.h planning_response.h  (5040 ms)
  ...

45443 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/include/moveit/robot_model/joint_model.h (included 54 times, avg 841 ms), included via:
  revolute_joint_model.cpp.o revolute_joint_model.h  (1887 ms)
  prismatic_joint_model.cpp.o prismatic_joint_model.h  (1856 ms)
  fixed_joint_model.cpp.o fixed_joint_model.h  (1836 ms)
  floating_joint_model.cpp.o floating_joint_model.h  (1824 ms)
  planar_joint_model.cpp.o planar_joint_model.h  (1815 ms)
  joint_model.cpp.o  (1633 ms)
  ...

  done in 0.2s.

After:

Analyzing build trace from 'output_file'...
**** Time summary:
Compilation (138 times):
  Parsing (frontend):          482.6 s
  Codegen & opts (backend):     81.4 s

**** Files that took longest to parse (compiler frontend):
 14196 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/robot_state.cpp.o
 14194 ms: build/moveit_core//planning_scene/CMakeFiles/moveit_planning_scene.dir/src/planning_scene.cpp.o
 13499 ms: build/moveit_core//kinematic_constraints/CMakeFiles/moveit_kinematic_constraints.dir/src/kinematic_constraint.cpp.o
 12941 ms: build/moveit_core//kinematics_metrics/CMakeFiles/moveit_kinematics_metrics.dir/src/kinematics_metrics.cpp.o
 12322 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_env_distance_field.cpp.o
 11725 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_env_hybrid.cpp.o
 10577 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_common_distance_field.cpp.o
 10416 ms: build/moveit_core//constraint_samplers/CMakeFiles/moveit_constraint_samplers.dir/src/default_constraint_samplers.cpp.o
 10348 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/conversions.cpp.o
 10285 ms: build/moveit_core//kinematic_constraints/CMakeFiles/moveit_kinematic_constraints.dir/src/utils.cpp.o

**** Files that took longest to codegen (compiler backend):
  6689 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/robot_state.cpp.o
  6445 ms: build/moveit_core//utils/CMakeFiles/moveit_test_utils.dir/src/robot_model_test_utils.cpp.o
  6375 ms: build/moveit_core//kinematics_metrics/CMakeFiles/moveit_kinematics_metrics.dir/src/kinematics_metrics.cpp.o
  4939 ms: build/moveit_core//collision_distance_field/CMakeFiles/moveit_collision_distance_field.dir/src/collision_env_distance_field.cpp.o
  4405 ms: build/moveit_core//planning_scene/CMakeFiles/moveit_planning_scene.dir/src/planning_scene.cpp.o
  4000 ms: build/moveit_core//robot_model/CMakeFiles/moveit_robot_model.dir/src/robot_model.cpp.o
  3286 ms: build/moveit_core//kinematic_constraints/CMakeFiles/moveit_kinematic_constraints.dir/src/kinematic_constraint.cpp.o
  2784 ms: build/moveit_core//kinematic_constraints/CMakeFiles/moveit_kinematic_constraints.dir/src/utils.cpp.o
  2409 ms: build/moveit_core//collision_detection/CMakeFiles/moveit_collision_detection.dir/src/collision_plugin_cache.cpp.o
  2389 ms: build/moveit_core//robot_state/CMakeFiles/moveit_robot_state.dir/src/conversions.cpp.o

**** Templates that took longest to instantiate:
 28937 ms: Eigen::Transform<double, 3, 1, 0>::computeRotationScaling<Eigen::Mat... (56 times, avg 516 ms)
 14855 ms: Eigen::JacobiSVD<Eigen::Matrix<double, 3, 3, 0>, 2>::JacobiSVD (56 times, avg 265 ms)
 14784 ms: Eigen::JacobiSVD<Eigen::Matrix<double, 3, 3, 0>, 2>::compute (56 times, avg 264 ms)
  9032 ms: Eigen::Transform<double, 3, 1, 0>::operator* (40 times, avg 225 ms)
  9028 ms: Eigen::internal::transform_transform_product_impl<Eigen::Transform<d... (40 times, avg 225 ms)
  5118 ms: Eigen::Matrix<double, 3, 3, 0>::Matrix<Eigen::Product<Eigen::Matrix<... (112 times, avg 45 ms)
  5115 ms: Eigen::MatrixBase<Eigen::Product<Eigen::Matrix<double, 3, 3, 0>, Eig... (56 times, avg 91 ms)
  5021 ms: Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0>>::PlainObjectB... (56 times, avg 89 ms)
  4986 ms: Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0>>::_set_noalias... (56 times, avg 89 ms)
  4979 ms: Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, 3, 3... (56 times, avg 88 ms)
  4944 ms: Eigen::internal::Assignment<Eigen::Matrix<double, 3, 3, 0>, Eigen::P... (56 times, avg 88 ms)
  4923 ms: Eigen::internal::generic_product_impl<Eigen::Matrix<double, 3, 3, 0>... (56 times, avg 87 ms)
  4829 ms: Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1, 0>, 2>::JacobiSVD (2 times, avg 2414 ms)
  4811 ms: Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1, 0>, 2>::compute (2 times, avg 2405 ms)
  4348 ms: Eigen::internal::qr_preconditioner_impl<Eigen::Matrix<double, -1, -1... (2 times, avg 2174 ms)
  4195 ms: Eigen::DenseBase<Eigen::Matrix<double, 3, 3, 0>>::isApprox<Eigen::Cw... (56 times, avg 74 ms)
  4186 ms: Eigen::internal::isApprox_selector<Eigen::Matrix<double, 3, 3, 0>, E... (56 times, avg 74 ms)
  4153 ms: Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, 3, 3... (56 times, avg 74 ms)
  4118 ms: Eigen::internal::Assignment<Eigen::Matrix<double, 3, 3, 0>, Eigen::P... (56 times, avg 73 ms)
  4114 ms: Eigen::internal::call_dense_assignment_loop<Eigen::Matrix<double, 3,... (56 times, avg 73 ms)
  4067 ms: rclcpp::Subscription<rcl_interfaces::msg::ParameterEvent_<std::alloc... (31 times, avg 131 ms)
  3744 ms: Eigen::internal::dense_assignment_loop<Eigen::internal::generic_dens... (56 times, avg 66 ms)
  3742 ms: Eigen::DenseBase<Eigen::Block<const Eigen::Matrix<double, 4, 4, 0>, ... (56 times, avg 66 ms)
  3729 ms: Eigen::internal::isApprox_selector<Eigen::Block<const Eigen::Matrix<... (56 times, avg 66 ms)
  3646 ms: Eigen::internal::copy_using_evaluator_DefaultTraversal_InnerUnrollin... (56 times, avg 65 ms)
  3637 ms: Eigen::internal::generic_dense_assignment_kernel<Eigen::internal::ev... (56 times, avg 64 ms)
  3633 ms: Eigen::internal::generic_dense_assignment_kernel<Eigen::internal::ev... (56 times, avg 64 ms)
  3629 ms: Eigen::internal::product_evaluator<Eigen::Product<Eigen::Matrix<doub... (56 times, avg 64 ms)
  3554 ms: rclcpp::Client<rcl_interfaces::srv::DescribeParameters> (31 times, avg 114 ms)
  3545 ms: Eigen::Matrix<double, 3, 1, 0>::operator=<Eigen::Product<Eigen::Bloc... (37 times, avg 95 ms)

**** Template sets that took longest to instantiate:
 55799 ms: Eigen::MatrixBase<$> (5234 times, avg 10 ms)
 37584 ms: Eigen::internal::call_assignment_no_alias<$> (1701 times, avg 22 ms)
 36640 ms: Eigen::internal::Assignment<$>::run (1677 times, avg 21 ms)
 33783 ms: Eigen::DenseBase<$> (5437 times, avg 6 ms)
 28937 ms: Eigen::Transform<$>::computeRotationScaling<$> (56 times, avg 516 ms)
 27510 ms: std::_Hashtable<$> (937 times, avg 29 ms)
 27261 ms: std::unordered_map<$> (693 times, avg 39 ms)
 27063 ms: Eigen::internal::call_assignment<$> (1253 times, avg 21 ms)
 26102 ms: Eigen::internal::call_dense_assignment_loop<$> (1749 times, avg 14 ms)
 26002 ms: Eigen::Matrix<$>::Matrix<$> (715 times, avg 36 ms)
 25070 ms: std::variant<$> (414 times, avg 60 ms)
 24521 ms: Eigen::PlainObjectBase<$>::_set_noalias<$> (558 times, avg 43 ms)
 23126 ms: Eigen::internal::generic_product_impl<$>::evalTo<$> (339 times, avg 68 ms)
 23079 ms: std::pair<$> (2190 times, avg 10 ms)
 22331 ms: std::__detail::__variant::_Variant_base<$> (414 times, avg 53 ms)
 22118 ms: std::__detail::_Insert<$> (815 times, avg 27 ms)
 21985 ms: std::__detail::_Insert_base<$> (815 times, avg 26 ms)
 21235 ms: std::__detail::_Hashtable_alloc<$> (815 times, avg 26 ms)
 20425 ms: rclcpp::Client<$> (186 times, avg 109 ms)
 20282 ms: std::__detail::_Hash_node<$> (748 times, avg 27 ms)
 20258 ms: std::__detail::_Hash_node_value<$> (748 times, avg 27 ms)
 20234 ms: std::__detail::_Hash_node_value_base<$> (748 times, avg 27 ms)
 20199 ms: __gnu_cxx::__aligned_buffer<$> (749 times, avg 26 ms)
 19684 ms: Eigen::JacobiSVD<$>::JacobiSVD (58 times, avg 339 ms)
 19595 ms: Eigen::JacobiSVD<$>::compute (58 times, avg 337 ms)
 19133 ms: std::unique_ptr<$> (1782 times, avg 10 ms)
 17467 ms: Eigen::internal::dense_assignment_loop<$>::run (1793 times, avg 9 ms)
 17010 ms: Eigen::Block<$> (1262 times, avg 13 ms)
 16796 ms: std::tuple<$> (2165 times, avg 7 ms)
 16715 ms: Eigen::BlockImpl<$> (1262 times, avg 13 ms)

**** Functions that took longest to compile:
   191 ms: kinematic_constraints::collectConstraints(std::shared_ptr<rclcpp::No... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematic_constraints/src/utils.cpp)
   167 ms: constraint_samplers::ConstraintSamplerManager::selectDefaultSampler(... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/constraint_samplers/src/constraint_sampler_manager.cpp)
   119 ms: trajectory_processing::IterativeSplineParameterization::computeTimeS... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/iterative_spline_parameterization.cpp)
   119 ms: moveit::core::RobotModel::constructJointModel(urdf::Link const*, srd... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/robot_model.cpp)
   119 ms: boost::re_detail_107400::basic_regex_parser<char, boost::regex_trait... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/utils/src/robot_model_test_utils.cpp)
   105 ms: moveit::core::JointModelGroup::JointModelGroup(std::__cxx11::basic_s... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/joint_model_group.cpp)
    92 ms: moveit::core::(anonymous namespace)::_robotStateMsgToRobotStateHelpe... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/conversions.cpp)
    82 ms: Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::compu... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_metrics/src/kinematics_metrics.cpp)
    81 ms: trajectory_processing::CircularPathSegment::CircularPathSegment(Eige... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)
    75 ms: collision_detection::CollisionEnvDistanceField::generateDistanceFiel... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_distance_field/src/collision_env_distance_field.cpp)
    74 ms: Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::compu... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/robot_state.cpp)
    71 ms: moveit::core::RobotState::setFromIKSubgroups(moveit::core::JointMode... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/robot_state.cpp)
    71 ms: moveit::core::RobotState::setFromIK(moveit::core::JointModelGroup co... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/robot_state.cpp)
    65 ms: collision_detection::collisionCallback(fcl::CollisionObject<double>*... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection_fcl/src/collision_common.cpp)
    60 ms: Eigen::EigenSolver<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::doCom... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_metrics/src/kinematics_metrics.cpp)
    58 ms: Eigen::internal::partial_lu_impl<double, 0, int, -1>::unblocked_lu(E... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_metrics/src/kinematics_metrics.cpp)
    58 ms: moveit::core::RobotModel::setKinematicsAllocators(std::map<std::__cx... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/robot_model.cpp)
    56 ms: moveit::core::attachedBodiesToAttachedCollisionObjectMsgs(std::vecto... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/src/conversions.cpp)
    56 ms: robot_trajectory::RobotTrajectory::getRobotTrajectoryMsg(moveit_msgs... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_trajectory/src/robot_trajectory.cpp)
    55 ms: trajectory_processing::Trajectory::integrateForward(std::__cxx11::li... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)
    54 ms: moveit::core::RobotModelBuilder::addChain(std::__cxx11::basic_string... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/utils/src/robot_model_test_utils.cpp)
    54 ms: moveit::core::RobotModel::buildJointInfo() (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/src/robot_model.cpp)
    54 ms: boost::re_detail_107400::basic_regex_creator<char, boost::regex_trai... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/utils/src/robot_model_test_utils.cpp)
    52 ms: collision_detection::refineContactNormals(std::shared_ptr<collision_... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/src/collision_octomap_filter.cpp)
    51 ms: pluginlib::ClassLoader<collision_detection::CollisionPlugin>::getAll... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/src/collision_plugin_cache.cpp)
    48 ms: trajectory_processing::Path::Path(std::__cxx11::list<Eigen::Matrix<d... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)
    48 ms: dynamics_solver::DynamicsSolver::DynamicsSolver(std::shared_ptr<move... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/dynamics_solver/src/dynamics_solver.cpp)
    46 ms: collision_detection::CollisionEnvDistanceField::getIntraGroupCollisi... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_distance_field/src/collision_env_distance_field.cpp)
    45 ms: boost::re_detail_107400::basic_regex_parser<char, boost::regex_trait... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/utils/src/robot_model_test_utils.cpp)
    44 ms: trajectory_processing::TimeOptimalTrajectoryGeneration::doTimeParame... (/home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp)

**** Function sets that took longest to compile / optimize:
   283 ms: std::_Rb_tree<$>::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_... (53 times, avg 5 ms)
   243 ms: std::vector<$>::_M_default_append(unsigned long) (52 times, avg 4 ms)
   191 ms: kinematic_constraints::collectConstraints(std::shared_ptr<$> const&,... (1 times, avg 191 ms)
   187 ms: std::__shared_ptr<$>::~__shared_ptr() (143 times, avg 1 ms)
   176 ms: std::_Rb_tree_iterator<$> std::_Rb_tree<$>::_M_emplace_hint_unique<$... (62 times, avg 2 ms)
   173 ms: Eigen::JacobiSVD<$>::compute(Eigen::Matrix<$> const&, unsigned int) (3 times, avg 57 ms)
   167 ms: constraint_samplers::ConstraintSamplerManager::selectDefaultSampler(... (1 times, avg 167 ms)
   165 ms: std::vector<$>::~vector() (104 times, avg 1 ms)
   157 ms: std::_Rb_tree<$>::_M_get_insert_unique_pos(std::__cxx11::basic_strin... (57 times, avg 2 ms)
   136 ms: visualization_msgs::msg::Marker_<$>::Marker_(visualization_msgs::msg... (8 times, avg 17 ms)
   122 ms: std::_Rb_tree<$>::_M_erase(std::_Rb_tree_node<$>*) (108 times, avg 1 ms)
   119 ms: boost::re_detail_107400::basic_regex_parser<$>::parse_perl_extension() (1 times, avg 119 ms)
   116 ms: void std::vector<$>::_M_range_insert<$>(__gnu_cxx::__normal_iterator... (11 times, avg 10 ms)
   105 ms: moveit::core::JointModelGroup::JointModelGroup(std::__cxx11::basic_s... (1 times, avg 105 ms)
   104 ms: void std::vector<$>::_M_realloc_insert<$>(__gnu_cxx::__normal_iterat... (17 times, avg 6 ms)
    95 ms: std::vector<$>::vector(std::vector<$> const&) (28 times, avg 3 ms)
    95 ms: void std::_Rb_tree<$>::_M_construct_node<$>(std::_Rb_tree_node<$>*, ... (48 times, avg 1 ms)
    92 ms: moveit::core::(anonymous namespace)::_robotStateMsgToRobotStateHelpe... (1 times, avg 92 ms)
    92 ms: non-virtual thunk to boost::wrapexcept<$>::~wrapexcept() (21 times, avg 4 ms)
    91 ms: Eigen::internal::product_triangular_matrix_matrix<$>::run(long, long... (8 times, avg 11 ms)
    86 ms: Eigen::internal::general_matrix_vector_product<$>::run(long, long, E... (6 times, avg 14 ms)
    84 ms: Eigen::internal::dense_assignment_loop<$>::run(Eigen::internal::gene... (11 times, avg 7 ms)
    84 ms: std::_Rb_tree<$>::find(std::__cxx11::basic_string<$> const&) const (35 times, avg 2 ms)
    82 ms: Eigen::ColPivHouseholderQR<$>::computeInPlace() (2 times, avg 41 ms)
    81 ms: trajectory_processing::CircularPathSegment::CircularPathSegment(Eige... (1 times, avg 81 ms)
    76 ms: void Eigen::internal::make_block_householder_triangular_factor<$>(Ei... (2 times, avg 38 ms)
    75 ms: collision_detection::CollisionEnvDistanceField::generateDistanceFiel... (1 times, avg 75 ms)
    74 ms: void Eigen::internal::make_block_householder_triangular_factor<$>(Ei... (2 times, avg 37 ms)
    71 ms: boost::re_detail_107400::basic_regex_creator<$>::append_set(boost::r... (2 times, avg 35 ms)
    71 ms: moveit::core::RobotState::setFromIKSubgroups(moveit::core::JointMode... (1 times, avg 71 ms)

*** Expensive headers:
134543 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/include/moveit/robot_model/robot_model.h (included 46 times, avg 2924 ms), included via:
  robot_model.cpp.o  (4084 ms)
  constraint_sampler_tools.cpp.o constraint_sampler_tools.h constraint_sampler.h planning_scene.h  (4055 ms)
  kinematics_metrics.cpp.o kinematics_metrics.h robot_state.h  (4022 ms)
  joint_model_group.cpp.o  (4002 ms)
  collision_common_distance_field.cpp.o collision_common_distance_field.h robot_state.h  (4001 ms)
  kinematic_constraint.cpp.o kinematic_constraint.h  (3963 ms)
  ...

111741 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/include/moveit/robot_model/joint_model_group.h (included 47 times, avg 2377 ms), included via:
  constraint_sampler_tools.cpp.o constraint_sampler_tools.h constraint_sampler.h planning_scene.h robot_model.h  (3133 ms)
  joint_model_group.cpp.o robot_model.h  (3110 ms)
  kinematics_metrics.cpp.o kinematics_metrics.h robot_state.h robot_model.h  (3109 ms)
  planning_response.cpp.o planning_response.h robot_trajectory.h robot_state.h robot_model.h  (3100 ms)
  iterative_spline_parameterization.cpp.o iterative_spline_parameterization.h robot_trajectory.h robot_state.h robot_model.h  (3078 ms)
  collision_common_distance_field.cpp.o collision_common_distance_field.h robot_state.h robot_model.h  (3076 ms)
  ...

66031 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h (included 47 times, avg 1404 ms), included via:
  kinematics_base.cpp.o  (2493 ms)
  dynamics_solver.cpp.o dynamics_solver.h robot_state.h robot_model.h joint_model_group.h  (1677 ms)
  constraint_sampler_tools.cpp.o constraint_sampler_tools.h constraint_sampler.h planning_scene.h robot_model.h joint_model_group.h  (1651 ms)
  kinematics_metrics.cpp.o kinematics_metrics.h robot_state.h robot_model.h joint_model_group.h  (1636 ms)
  planning_response.cpp.o planning_response.h robot_trajectory.h robot_state.h robot_model.h joint_model_group.h  (1622 ms)
  joint_model_group.cpp.o robot_model.h joint_model_group.h  (1613 ms)
  ...

62084 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/include/moveit/collision_detection/collision_common.h (included 29 times, avg 2140 ms), included via:
  collision_env_bullet.cpp.o collision_env_bullet.h collision_env.h collision_matrix.h  (4118 ms)
  collision_octomap_filter.cpp.o  (4065 ms)
  collision_env.cpp.o collision_env.h collision_matrix.h  (4051 ms)
  collision_matrix.cpp.o collision_matrix.h  (4042 ms)
  collision_tools.cpp.o collision_tools.h  (4036 ms)
  collision_env_allvalid.cpp.o collision_env_allvalid.h collision_env.h collision_matrix.h  (4033 ms)
  ...

60241 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_state/include/moveit/robot_state/robot_state.h (included 33 times, avg 1825 ms), included via:
  kinematics_metrics.cpp.o kinematics_metrics.h  (4318 ms)
  collision_common_distance_field.cpp.o collision_common_distance_field.h  (4288 ms)
  conversions.cpp.o conversions.h  (4228 ms)
  robot_state.cpp.o  (4225 ms)
  planning_response.cpp.o planning_response.h robot_trajectory.h  (4065 ms)
  iterative_time_parameterization.cpp.o iterative_time_parameterization.h robot_trajectory.h  (4035 ms)
  ...

57033 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_trajectory/include/moveit/robot_trajectory/robot_trajectory.h (included 19 times, avg 3001 ms), included via:
  iterative_spline_parameterization.cpp.o iterative_spline_parameterization.h  (6074 ms)
  planning_response.cpp.o planning_response.h  (6007 ms)
  robot_trajectory.cpp.o  (6005 ms)
  iterative_time_parameterization.cpp.o iterative_time_parameterization.h  (6000 ms)
  planning_interface.cpp.o planning_interface.h planning_response.h  (5049 ms)
  planning_request_adapter.cpp.o planning_request_adapter.h planning_interface.h planning_response.h  (5039 ms)
  ...

45422 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/robot_model/include/moveit/robot_model/joint_model.h (included 54 times, avg 841 ms), included via:
  prismatic_joint_model.cpp.o prismatic_joint_model.h  (1869 ms)
  floating_joint_model.cpp.o floating_joint_model.h  (1839 ms)
  planar_joint_model.cpp.o planar_joint_model.h  (1834 ms)
  fixed_joint_model.cpp.o fixed_joint_model.h  (1823 ms)
  revolute_joint_model.cpp.o revolute_joint_model.h  (1806 ms)
  joint_model.cpp.o  (1630 ms)
  ...

45073 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/planning_scene/include/moveit/planning_scene/planning_scene.h (included 12 times, avg 3756 ms), included via:
  constraint_sampler_tools.cpp.o constraint_sampler_tools.h constraint_sampler.h  (6794 ms)
  constraint_sampler.cpp.o constraint_sampler.h  (6667 ms)
  default_constraint_samplers.cpp.o default_constraint_samplers.h constraint_sampler.h  (6620 ms)
  union_constraint_sampler.cpp.o union_constraint_sampler.h constraint_sampler.h  (6549 ms)
  constraint_sampler_manager.cpp.o constraint_sampler_manager.h constraint_sampler_allocator.h constraint_sampler.h  (6545 ms)
  planning_scene.cpp.o  (5313 ms)
  ...

41866 ms: /usr/include/eigen3/Eigen/Geometry (included 63 times, avg 664 ms), included via:
  aabb.cpp.o aabb.h  (1447 ms)
  contact_checker_common.cpp.o contact_checker_common.h  (1329 ms)
  link_model.cpp.o link_model.h  (1239 ms)
  attached_body.cpp.o attached_body.h link_model.h  (1207 ms)
  collision_distance_field_types.cpp.o collision_distance_field_types.h bodies.h aabb.h  (1005 ms)
  transforms.cpp.o transforms.h  (966 ms)
  ...

38439 ms: /home/jafar/workspaces/ros2/ws_moveit2_compile_profiling/src/moveit2/moveit_core/collision_detection/include/moveit/collision_detection/collision_matrix.h (included 26 times, avg 1478 ms), included via:
  collision_env_bullet.cpp.o collision_env_bullet.h collision_env.h  (4165 ms)
  collision_env.cpp.o collision_env.h  (4096 ms)
  collision_matrix.cpp.o  (4086 ms)
  collision_env_allvalid.cpp.o collision_env_allvalid.h collision_env.h  (4077 ms)
  collision_env_fcl.cpp.o collision_env_fcl.h collision_env.h  (4013 ms)
  collision_env_hybrid.cpp.o collision_detector_allocator_hybrid.h collision_detector_allocator.h collision_env.h  (4003 ms)
  ...

  done in 0.2s.

@JafarAbdi
Copy link
Member Author

If anyone is interested in helping, please let me know, we have 37 packages and this PR only touch one :D

@JafarAbdi JafarAbdi force-pushed the pr-compile_time_improvements branch from 856900f to 5014e24 Compare June 10, 2022 15:55
@JafarAbdi
Copy link
Member Author

Ok, I did the same for the whole codebase, I got ~286s reduction see https://gist.github.com/JafarAbdi/cd9735c2eb9cdf6e8906e057c9b18590

@JafarAbdi JafarAbdi force-pushed the pr-compile_time_improvements branch from 7d1d55d to 4ed6ecb Compare June 10, 2022 20:27
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #1333 (3a5732a) into main (990925e) will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1333      +/-   ##
==========================================
+ Coverage   61.56%   61.58%   +0.02%     
==========================================
  Files         274      274              
  Lines       24966    24965       -1     
==========================================
+ Hits        15369    15373       +4     
+ Misses       9597     9592       -5     
Impacted Files Coverage Δ
..._detection/src/allvalid/collision_env_allvalid.cpp 7.85% <ø> (ø)
..._core/collision_detection/src/collision_common.cpp 50.00% <ø> (ø)
...eit_core/collision_detection/src/collision_env.cpp 72.58% <ø> (ø)
..._core/collision_detection/src/collision_matrix.cpp 37.15% <ø> (ø)
...llision_detection/src/collision_octomap_filter.cpp 0.00% <ø> (ø)
...collision_detection/src/collision_plugin_cache.cpp 82.36% <ø> (ø)
...t_core/collision_detection/src/collision_tools.cpp 0.00% <ø> (ø)
moveit_core/collision_detection/src/world.cpp 88.11% <ø> (ø)
...src/bullet_integration/bullet_cast_bvh_manager.cpp 52.86% <ø> (+1.43%) ⬆️
...bullet_integration/bullet_discrete_bvh_manager.cpp 50.00% <ø> (ø)
... and 65 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 990925e...3a5732a. Read the comment docs.

Copy link
Member

@tylerjw tylerjw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice change, thank you.

@v4hn
Copy link
Contributor

v4hn commented Jun 11, 2022 via email

@JafarAbdi JafarAbdi force-pushed the pr-compile_time_improvements branch from 42f9c7a to 4551c69 Compare June 13, 2022 18:17
@JafarAbdi JafarAbdi force-pushed the pr-compile_time_improvements branch from 4551c69 to 3a5732a Compare June 13, 2022 22:30
@henningkayser henningkayser merged commit 3d49131 into moveit:main Jun 14, 2022
peterdavidfagan pushed a commit to peterdavidfagan/moveit2 that referenced this pull request Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants