Closed veqcc closed 1 month ago
Currently, 15~20% of CPU time is comsumed by ostream in RunOutModule. See the following flamegraph: The purple ones are related to ostream
ostream
RunOutModule
ostream is used here: https://github.com/autowarefoundation/autoware.universe/blob/583cd8518bb9de6ebe334fe87c5e4cd8de62da3b/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp#L201C3-L208C101
// for debug std::stringstream ss; for (unsigned int i = 0; i < ts.size(); ++i) { ss << "t: " << ts.at(i) << ", x: " << xs.at(i) << ", v: " << vs.at(i) << ", a: " << as.at(i) << ", j: " << js.at(i) << std::endl; } RCLCPP_DEBUG( rclcpp::get_logger("velocity_planning_utils"), "Calculate stop velocity. %s", ss.str().c_str());
Performance improvement
If it is only for debugging, consider eliminating them. Or, avoid using them in release builds.
ostream is eliminated from RunOutModule in release builds.
Thank you! I created the PR. Could you see it? https://github.com/autowarefoundation/autoware.universe/pull/7131
Checklist
Description
Currently, 15~20% of CPU time is comsumed by
ostream
inRunOutModule
. See the following flamegraph: The purple ones are related toostream
ostream
is used here: https://github.com/autowarefoundation/autoware.universe/blob/583cd8518bb9de6ebe334fe87c5e4cd8de62da3b/planning/motion_velocity_smoother/src/smoother/analytical_jerk_constrained_smoother/velocity_planning_utils.cpp#L201C3-L208C101Purpose
Performance improvement
Possible approaches
If it is only for debugging, consider eliminating them. Or, avoid using them in release builds.
Definition of done
ostream
is eliminated from RunOutModule in release builds.