Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 0.2.0
License BSD 3.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description Framework to evaluate peformance of ROS 2
Checkout URI https://github.com/irobot-ros/ros2-performance.git
VCS Type git
VCS Version rolling
Last Updated 2025-04-10
Dev Status UNKNOWN
Released UNRELEASED
Tags benchmark performance cpp ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Classes for generating ROS2 nodes and measuring their performance

Additional Links

No additional links.

Maintainers

  • Alberto Soragna
  • Juan Oxoby

Authors

  • Alberto Soragna

ROS2 Performance Test

Create a sample application

This package defines the performance_test::PerformanceNode class. This class inherits from rclcpp::Node and provides APIs for easily adding any number of publishers, subscriptions, clients and servers to the node.

Each of the PerformanceNode::add_periodic_publisher, PerformanceNode::add_subscriber, etc. methods are based on a template in order to allow the creation of systems with different types of messages.

#include "performance_test/performance_node_base.hpp"
auto sub_node = std::make_shared<performance_test::PerformanceNode<rclcpp::Node>>("my_sub_node");
sub_node->add_subscriber<performance_test_msgs::msg::Stamped10b>("my_topic_name");

This snippet of code will create a new node called my_sub_node and this node will have a subscriber on my_topic_name where are published messages of type 10b, i.e. a message with an header field and a statically allocated array of size 10 bytes.

Similarly you can create a second node which publishes data periodically.

#include "performance_test/performance_node_base.hpp"
auto pub_node = std::make_shared<performance_test::PerformanceNode<rclcpp::Node>>("my_pub_node");
pub_node->add_periodic_publisher("my_topic_name", std::chrono::milliseconds(100));

Note: you can create nodes with any number of publishers/subscribers/clients/servers, with no constraints on their types.

Once you have defined all your nodes, you have to start them. We provide the performance_test::System class for managing the nodes execution.

#include "performance_test/system.hpp"
auto experiment_duration = std::chrono::seconds(10);
System ros2_system();
ros2_system.add_node(pub_node);
ros2_system.add_node(sub_node);
ros2_system.spin(experiment_duration);

This is enough for running your nodes. While they communicate, they will internally record latency and reliability statistics. At the end of the experiment, you can use the performance_test::System API to print them.

ros2_system.print_latency_stats();
ros2_system.save_latency_stats_to_file("my_output_file.txt");

Additionally, you can also monitor other type of statistics: resource usage and events. Resource usage consists of CPU and several RAM metrics (heap, RSS, VRT). Events on the other hand are for example the end of the discovery phase and late or lost messages.

In order to enable monitoring or resource usage you have to add the following snippet to your code:

#include "performance_metrics/resource_usage_logger.hpp"
performance_metrics::ResourceUsageLogger ru_logger("resource_usage_output.txt");
auto sampling_period = std::chrono::milliseconds(500);
ru_logger.start(sampling_period);

/**
 * your code to monitor goes here
 */

ru_logger.stop();

Visualizing the results

This repository contains Python scripts useful for plotting and aggregating data from multiple CSV files. You can find them under scripts/plot_scripts.

Note that these scripts require Python3 and should be run on your laptop once you have copied there the experiment results from the embedded platform.

There are two different types of CSV currently produced by our experiments. For this reason we have two different scripts to plot them.

  • Latency and reliability: scripts/plot_scripts/latency_reliability_plot.py

  • CPU and Memory: scripts/plot_scripts/cpu_ram_plot.py

The two scripts share most of the code, located under scripts/plot_scripts/plot_common.py. So let’s first describe some common features.

You have to use command line arguments to tell the script which CSV files you want to load and which data you want to plot.

For a full description of the command line options, as well as an up-to-date list of the accpted values, use

python3 scripts/plot_scripts/cpu_ram_plot.py --help
  • dir_paths: This is a mandatory positional argument which requires one or more paths to the CSV files. Note that it is possible to pass paths of files, directories or a mixture of them.
  • x: the metric to show on the X axis.
  • y: the metric(s) to show on the Y axis.
  • y2: the metric(s) to show on the secon Y axis (optional).
  • separator: a value according to which you want to separate your data creating different plot lines on the same axes (optional).

Starting from the easy things, you may want to plot the average CPU usage of running a ROS2 system.

python3 scripts/plot_scripts/cpu_ram_plot.py path_to_a_csv_file --x time --y cpu

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 2.3.0
License Apache 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://gitlab.com/ApexAI/performance_test.git
VCS Type git
VCS Version master
Last Updated 2025-07-15
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Tool to test performance of ROS 2 and DDS data layers and communication.

Additional Links

No additional links.

Maintainers

  • Apex.AI, Inc.

Authors

No additional authors.

performance_test

[TOC]

The performance_test tool tests latency and other performance metrics of various middleware implementations that support a pub/sub pattern. It is used to simulate non-functional performance of your application.

The performance_test tool allows you to quickly set up a pub/sub configuration, e.g. number of publisher/subscribers, message size, QOS settings, middleware. The following metrics are automatically recorded when the application is running:

  • latency: corresponds to the time a message takes to travel from a publisher to subscriber. The latency is measured by timestamping the sample when it’s published and subtracting the timestamp (from the sample) from the measured time when the sample arrives at the subscriber (only logged when a subscriber is created)
  • CPU usage: percentage of the total system wide CPU usage (logged separately for each instance of perf_test)
  • resident memory: heap allocations, shared memory segments, stack (used for system’s internal work) (logged separately for each instance of perf_test)
  • sample statistics: number of samples received, sent, and lost per experiment run.

This master branch is compatible with the following ROS 2 versions

  • rolling
  • jazzy
  • iron
  • humble
  • galactic
  • foxy
  • eloquent
  • dashing
  • Apex.OS

How to use this document

  1. Start here for a quick example of building and running the performance_test tool with the Cyclone DDS plugin.
  2. If needed, find more detailed information about building and running
  3. Or, if the quick example is good enough, skip ahead to the list of supported middleware plugins to learn how to test a specific middleware implementation.
  4. Check out the tools for visualizing the results
  5. If desired, read about the design and architecture of the tool.

Example

This example shows how to test the non-functional performance of the following configuration:

Option Value
Plugin Cyclone DDS
Message type Array1k
Publishing rate 100Hz
Topic name test_topic
Duration of the experiment 30s
Number of publisher(s) 1 (default)
Number of subscriber(s) 1 (default)
  1. Install ROS 2

  2. Install Cyclone DDS to /opt/cyclonedds

  3. Build performance_test with the CMake build flag for Cyclone DDS:

    source /opt/ros/rolling/setup.bash
    cd ~/perf_test_ws
    colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=CYCLONEDDS
    source ./install/setup.bash
    
  1. Run with the communication plugin option for Cyclone DDS:
mkdir experiment
./install/performance_test/lib/performance_test/perf_test --communication CycloneDDS
                                                          --msg Array1k
                                                          --rate 100
                                                          --topic test_topic
                                                          --max-runtime 30
                                                          --logfile experiment/log.csv

At the end of the experiment, a CSV log file will be generated in the experiment folder with a name that starts with log.

Building the performance_test tool

For a simple example, see Dockerfile.rclcpp.

The performance_test tool is structured as a ROS 2 package, so colcon is used to build it. Therefore, you must source a ROS 2 installation:

source /opt/ros/rolling/setup.bash

Select a middleware plugin from this list. Then build the performance_test tool with the selected middleware:

```bash mkdir -p ~/perf_test_ws/src

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package performance_test

X.Y.Z (YYYY/MM/DD)

2.3.0 (2024/09/24)

Removed

  • Moved apex_performance_plotter to its own package here

2.2.0 (2024/05/15)

Added

  • performance_test can be built with ROS 2 Iron and Jazzy

    Changed

  • Renamed the --dds-domain_id CLI arg to --dds-domain-id
  • When --dds-domain-id is unspecified, fall back to the ROS_DOMAIN_ID environment variable
  • --zero-copy has been separated into two flags:
    • --shared-memory: Enable shared-memory transfer in the plugin. This is meant to replace the need to manually set runtime flags via CYCLONEDDS_URI, APEX_MIDDLEWARE_SETTINGS, etc.
    • --loaned-samples: When publishing messages in the plugin, borrow loaned samples instead of publishing by copy
    • --zero-copy is now an alias for --shared-memory --loaned-samples
    • Supported plugins include:
      • -c CycloneDDS
      • -c CycloneDDS-CXX
      • -c ApexOSPollingSubscription
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
      • -c rclcpp-* with RMW_IMPLEMENTATION=rmw_fastrtps_cpp

2.1.0 (2024/04/17)

Added

  • Add new function prepare() to the Publisher and Subscriber API, intended to allow participant discovery without blocking the main thread

    Changed

  • Change the default --history arg from KEEP_ALL to KEEP_LAST
  • Change the default --history-depth arg from 1000 to 16
  • If --expected-num-pubs is unspecified, set it to the same value as -p
  • If --expected-num-subs is unspecified, set it to the same value as -s

    Fixed

  • Removed an unused variable to fix a Clang build
  • Remove unused variable names in the Plugin abstract class
  • Fix a potential lockup in PublisherTask on QNX

2.0.0 (2024/03/19)

Added

  • Add experimental bazel support
    • bazel build //performance_test --//:plugin_implementation=//path/to/a/plugin
  • Add a rudimentary socket-based plugin for testing the bazel support
    • bazel run //performance_test --//:plugin_implementation=//performance_test/plugins/demo:demo_plugin -- --help

      Changed

  • Instead of enabling/disabling each plugin, you select exactly one with a CMake string option, for example:
    • colcon build --cmake-args -DPERFORMANCE_TEST_PLUGIN=ROS2
  • Renamed the --communication CLI arg to --communicator. The short -c is unchanged.

    Removed

  • Removed the deprecated CLI flags for QOS settings:
    • Instead of --reliable, use --reliability RELIABLE
    • Instead of --transient, use --durability TRANSIENT_LOCAL
    • Instead of --keep-last, use --history KEEP_LAST
  • Removed the obsolete BoundedSequenceFlat messages
  • Removed the superfluous --msg-list CLI flag. The --help message already lists the available messages.

    Fixed

  • Update the Apex.OS Runner to use executor_runner::deferred instead of executor_runner::deferred_tag()
  • Ensure that the first few published samples are sent at the expected rate

1.5.2 (YYYY/MM/DD)

Added

  • --prevent-cpu-idle is available on QNX

    Changed

  • JSON log files will contain all values in the APEX_PERFORMANCE_TEST dictionary, instead of the five specific values used previously
  • Switch to build as C++17 by default

    Fixed

  • Zero copy transfer is again enabled for the rclcpp publisher

1.5.0 (2023/06/14)

Added

  • New CLI switch --prevent-cpu-idle (linux only). When specified, perf_test will use /dev/cpu_dma_latency to request that the CPU not enter any sleep states, to potentially give more consistent results
  • Some smaller Array messages, down to 32 bits
  • Added support to the FastDDS plugin for bounded and unbounded sequences

    Changed

  • Update the README to better explain how to use this tool with Apex.OS
  • In the Runner, allocate the AnalysisResults on the stack instead of using shared_ptr
  • Subscriber methods accept a callback parameter, instead of returning a vector of results, to reduce heap usage
  • Refactored the interaction between SubscriberStats and AnalysisResult to remove the need for a std::vector of latency samples, to reduce heap usage
  • Adjusted the Array message sizes to make the name match the contents
  • Updated apex_os_communicator to use the new zero-copy API

1.4.2 (2023/03/15)

Added

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged performance_test at Robotics Stack Exchange