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

Micro-optimizations in rcl #965

Merged
merged 3 commits into from
Mar 11, 2022
Merged

Commits on Mar 9, 2022

  1. Only check wait_set->impl for NULL pointer.

    The previous line already checked wait_set for NULL pointer,
    so there is no reason to call rcl_wait_set_is_valid and
    recheck that pointer.
    
    Signed-off-by: Chris Lalancette <[email protected]>
    clalancette committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    f8cd42a View commit details
    Browse the repository at this point in the history
  2. Refactor the debug messages in rcl_wait().

    This should slightly improve their performance by only
    calling them when necessary, and combining the output of
    the various outputs to effectively "batch" them together.
    
    Signed-off-by: Chris Lalancette <[email protected]>
    clalancette committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    bba931f View commit details
    Browse the repository at this point in the history
  3. Remove some debug statements from rcl_wait.

    While profiling an application, I found that a lot of time was
    spent just checking whether a log message should be output
    or not based on the current debug level.  None of the individual
    calls are expensive, but since rcl_wait is called so often,
    it ends up showing up in the profile.
    
    This patch somewhat controversially removes the debug statements
    from rcl_wait().  My view on it is that the utility of these
    is fairly low (if you ever turned them on, you would be flooded
    with information), and the cost is relatively high.  If you
    are really debugging this stuff, you can add in your own, more
    targeted debug statements or use a debugger.
    
    Signed-off-by: Chris Lalancette <[email protected]>
    clalancette committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    953de44 View commit details
    Browse the repository at this point in the history