Skip to content

Poor CPU performance with Type Adapters when using references #2199

Description

@Yadunund

Bug report

Required Info:

  • Operating System:
    • Ubuntu Jammy 22.04
  • Installation type:
    • Source
  • Version or commit hash:
    • rclcpp 21.1.0
  • DDS implementation:
    • fastdds or cyclone
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

It appears when publishers move + publish a Message<T> and subscription callbacks have a signature of std::function<void(const<MessageT& msg)> , the CPU load is a lot higher compared to when dealing with shared_ptr<Message<T>> or unique_ptr<Message<T>>

From my experience the CPU load for the former is almost an order of magnitude greater.
I've setup a package here with minimal reproducible code.
It appears the Intraprocess manager might not be handing moved references properly.

Expected behavior

CPU load is the same for 1 pub + 1 sub.

Actual behavior

Additional information


Feature request

Feature description

Implementation considerations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions