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

Performance improvements in Rosbag2 recorder discovery #1825

Merged

Conversation

Rayman
Copy link
Contributor

@Rayman Rayman commented Sep 27, 2024

  • This PR improves the performance of the Rosbag2 recorder discovery by moving graph checks such as topic_is_unpublished(topic_name, *node_graph_)) and is_leaf_topic(topic_name, *node_graph_)), which are expensive to the end of the checklist.

  • This PR is similar to the fix from 51a83f4 which was discussed in CPU overhead when discovery is used #1485. This gives a massive CPU improvement.

  • In the screenshot below you can see the performance difference:

Screenshot from 2024-09-27 15-22-25

@Rayman Rayman requested a review from a team as a code owner September 27, 2024 13:24
@Rayman Rayman requested review from gbiggs and james-rms and removed request for a team September 27, 2024 13:24
Reintroduce the fix from 51a83f4 which
was discussed in ros2#1485. This gives
a massive CPU improvement.

Signed-off-by: Ramon Wijnands <ramon.wijnands@nobleo.nl>
@Rayman Rayman force-pushed the feature/reduce-discovery-overhead branch from d141e90 to 80a9816 Compare September 27, 2024 13:24
@MichaelOrlov
Copy link
Contributor

@Rayman I would say that PR description "Reintroduce Don't warn for unknown types if topics are not selected" and reference to the

Reintroduce the fix from 51a83f4

Is incorrect in this case. While both PRs improve performance in the discovery, they are completely different.

@fujitatomoya
Copy link
Contributor

@MichaelOrlov @Rayman so this discovery improvement provided originally #1466, kinda rolled back because of #1480, right? just checking if i understand correctly.

CC: @Barry-Xu-2018

Copy link
Contributor

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

I think that checking recording options parameter and return immediately before time expensive API call for NodeGraph would be better for user experience.

@Rayman
Copy link
Contributor Author

Rayman commented Oct 1, 2024

Yes, I'm referencing the commit Move checks for single type and hidden topics to the bottom from that squashed PR 51a83f4. That commit got rolled back because of #1485. The node graph checks are quite expensive so I'd move them to the bottom.

@Rayman Rayman changed the title Reintroduce Don't warn for unknown types if topics are not selected Reintroduce Move checks for single type and hidden topics to the bottom Oct 1, 2024
@MichaelOrlov MichaelOrlov changed the title Reintroduce Move checks for single type and hidden topics to the bottom Performance improvements in Rosbag2 recorder's discovery Oct 2, 2024
@MichaelOrlov MichaelOrlov changed the title Performance improvements in Rosbag2 recorder's discovery Performance improvements in Rosbag2 recorder discovery Oct 2, 2024
@MichaelOrlov
Copy link
Contributor

@Rayman To be clear in this PR you are not doing "Move checks for single type and hidden topics to the bottom" - therefore we can't say that this PR reintroducing changes from the 51a83f4

I've changed PR title and description accordingly.

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

Now, with the corrected PR title and description, it looks good to me.

@MichaelOrlov
Copy link
Contributor

Pulls: #1825
Gist: https://gist.githubusercontent.com/MichaelOrlov/bc40716811cdff501cae1551da0b955c/raw/5d6c90a2f967cc06fbc14d9efb7d1296caf4ed8c/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_transport
TEST args: --packages-above rosbag2_transport
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14653

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@MichaelOrlov MichaelOrlov merged commit e75d6d6 into ros2:rolling Oct 3, 2024
12 checks passed
@MichaelOrlov
Copy link
Contributor

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented Oct 3, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Oct 3, 2024
…#1825)

Reintroduce the fix from 51a83f4 which
was discussed in #1485. This gives
a massive CPU improvement.

Signed-off-by: Ramon Wijnands <ramon.wijnands@nobleo.nl>
(cherry picked from commit e75d6d6)
@Rayman Rayman deleted the feature/reduce-discovery-overhead branch October 4, 2024 08:40
MichaelOrlov pushed a commit that referenced this pull request Oct 7, 2024
…#1825) (#1827)

Reintroduce the fix from 51a83f4 which
was discussed in #1485. This gives
a massive CPU improvement.

Signed-off-by: Ramon Wijnands <ramon.wijnands@nobleo.nl>
(cherry picked from commit e75d6d6)

Co-authored-by: Ramon Wijnands <ramon.wijnands007@gmail.com>
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.

3 participants