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

Replace ostream to lightweight ones in RunOutModule #7111

Closed
3 tasks done
veqcc opened this issue May 24, 2024 · 1 comment
Closed
3 tasks done

Replace ostream to lightweight ones in RunOutModule #7111

veqcc opened this issue May 24, 2024 · 1 comment

Comments

@veqcc
Copy link
Contributor

veqcc commented May 24, 2024

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I've agreed with the maintainers that I can plan this task.

Description

Currently, 15~20% of CPU time is comsumed by ostream in RunOutModule. See the following flamegraph:
The purple ones are related to ostream
Screenshot from 2024-05-24 13-23-48

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());

Purpose

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.

@rej55
Copy link
Contributor

rej55 commented May 27, 2024

Thank you!
I created the PR. Could you see it?
#7131

@veqcc veqcc closed this as completed May 31, 2024
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

No branches or pull requests

2 participants