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

Revamp how we check for the correct class. #218

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

clalancette
Copy link
Contributor

In an issue it was pointed out that we are decref'ing before we actually use some of the data, which means that in theory the garbage collector could reclaim the data before we used it. So the original point of this change was to fix that issue.

However, while looking at it I realized we could slightly improve performance here by avoiding a copy of the class and module into a combined string. Instead, we can compare them separately, which should reduce the copies.

This is a partial solution to #217 ; the other reported bug in there will require a much more extensive rework.

In an issue it was pointed out that we are decref'ing
before we actually use some of the data, which means that
in theory the garbage collector could reclaim the data
before we used it.  So the original point of this change
was to fix that issue.

However, while looking at it I realized we could slightly
improve performance here by avoiding a copy of the class
and module into a combined string.  Instead, we can compare
them separately, which should reduce the copies.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette
Copy link
Contributor Author

clalancette commented Oct 2, 2024

Pulls: #218
Gist: https://gist.githubusercontent.com/clalancette/1319b32b184fce38189666d4e4e69c43/raw/2b4fb3b5d7b2c647a8f6fe22b9010efcd374125e/ros2.repos
BUILD args: --packages-above-and-dependencies ament_cmake_core
TEST args: --packages-above ament_cmake_core
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14647

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

Since the variables are only used in an assert, which
can be compiled out, this could lead to a warning.
Inline the call instead, which should get rid of the warning.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette
Copy link
Contributor Author

I had to add a fix when building in Release mode. Another set of CI is upcoming.

@clalancette
Copy link
Contributor Author

clalancette commented Oct 2, 2024

Pulls: #218
Gist: https://gist.githubusercontent.com/clalancette/1319b32b184fce38189666d4e4e69c43/raw/2b4fb3b5d7b2c647a8f6fe22b9010efcd374125e/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14647

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

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.

1 participant