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

Minor performance improvements #809

Merged
merged 4 commits into from
Oct 17, 2022
Merged

Conversation

achim-k
Copy link
Contributor

@achim-k achim-k commented Oct 12, 2022

Public API Changes
None

Description
This PR adds some minor performance improvements and prepares to migrate to a multi-threaded executor later on. Please see the individual commits for a more detailed description of the changes.

A main performance bottleneck is still the Python GIL. I created an issue on rclpy to release the GIL when calling into rcl: ros2/rclpy#1025

The function `IOLoop.add_callback` is thread-safe and doesn't need to
be protected for mutual access. And since the `self.prewrite_mssage` is
only executed in the tornado event loop, there is no need for the write
lock.
This is more explicit and avoids some computationaly overhead.
While this does not have any effect on the current single-threaded
implementation, it will pave the way for a multi-threaded executor
later on.
@achim-k achim-k requested a review from jtbandes October 12, 2022 15:55
@achim-k achim-k merged commit a093509 into ros2 Oct 17, 2022
@achim-k achim-k deleted the achim/minor_performance_improvements branch October 17, 2022 17:38
sathak93 added a commit to sathak93/rosbridge_suite that referenced this pull request Jan 10, 2023
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.

None yet

2 participants