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

Benchmark lifecycle features #1462

Merged
merged 2 commits into from
Nov 19, 2020
Merged

Conversation

brawner
Copy link
Contributor

@brawner brawner commented Nov 17, 2020

This PR adds benchmarks for lifecycle node features, including rclcpp::LifecycleNode construction/destruction, state machine methods, and construction+destruction for State/Transition types.

Much of the API of rclcpp::LifecycleNode calls the node interface's API, which are benchmarked elsewhere, so I did not include those here.

Signed-off-by: Stephen Brawner brawner@gmail.com

@brawner brawner requested a review from cottsay November 17, 2020 00:01
@brawner
Copy link
Contributor Author

brawner commented Nov 17, 2020

Building with benchmarks on, testing --packages-select rclcpp_lifecycle

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Member

@cottsay cottsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nitpicks.

@cottsay
Copy link
Member

cottsay commented Nov 17, 2020

benchmark_lifecycle_client:

-------------------------------------------------------------------------------------------------------------
Benchmark                                                   Time             CPU   Iterations UserCounters...
-------------------------------------------------------------------------------------------------------------
BenchmarkLifecycleClient/get_state                     195772 ns        61088 ns        10313 heap_allocations=8.47813
BenchmarkLifecycleClient/change_state                  428399 ns       125877 ns         5793 heap_allocations=16.9871
BenchmarkLifecycleClient/get_available_states          212097 ns        68654 ns        10280 heap_allocations=9.18356
BenchmarkLifecycleClient/get_available_transitions     208669 ns        67407 ns        13291 heap_allocations=9.28388
BenchmarkLifecycleClient/get_transition_graph          277065 ns       107590 ns         6135 heap_allocations=26.6667

benchmark_lifecycle_node:

----------------------------------------------------------------------------------------------------------------------
Benchmark                                                            Time             CPU   Iterations UserCounters...
----------------------------------------------------------------------------------------------------------------------
BenchmarkLifecycleNodeConstruction/construct_lifecycle_node   11560168 ns     11545396 ns           60 heap_allocations=5.3143k
BenchmarkLifecycleNodeConstruction/destroy_lifecycle_node      5913835 ns      5566607 ns          126 heap_allocations=171.921
BenchmarkLifecycleNode/get_current_state                          68.6 ns         68.6 ns     10227245 heap_allocations=0
BenchmarkLifecycleNode/get_available_states                       8518 ns         8518 ns        79652 heap_allocations=5
BenchmarkLifecycleNode/get_available_transitions                 11385 ns        11384 ns        60252 heap_allocations=6
BenchmarkLifecycleNode/transition_valid_state                    16895 ns        16895 ns        41840 heap_allocations=10

benchmark_state:

---------------------------------------------------------------------------------------------------
Benchmark                                         Time             CPU   Iterations UserCounters...
---------------------------------------------------------------------------------------------------
PerformanceTest/construct_destruct_state       2300 ns         2300 ns       303327 heap_allocations=2
PerformanceTest/copy_destruct_state            2313 ns         2313 ns       303493 heap_allocations=2.00001

benchmark_transition:

--------------------------------------------------------------------------------------------------------
Benchmark                                              Time             CPU   Iterations UserCounters...
--------------------------------------------------------------------------------------------------------
PerformanceTest/construct_destruct_transition       2328 ns         2328 ns       299758 heap_allocations=2
PerformanceTest/copy_destruct_transition            2337 ns         2337 ns       298487 heap_allocations=2.00001

Signed-off-by: Stephen Brawner <brawner@gmail.com>
Signed-off-by: Stephen Brawner <brawner@gmail.com>
@brawner brawner force-pushed the brawner/rclcpp_lifecycle-benchmarks branch from 2706680 to 3151248 Compare November 18, 2020 02:12
@brawner
Copy link
Contributor Author

brawner commented Nov 18, 2020

Rebased onto master as well after merging #1464 and #1461

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@brawner
Copy link
Contributor Author

brawner commented Nov 19, 2020

Aarch and Windows show expected warnings. Rpr job fails because performance_test_fixture needs a release.

@brawner brawner merged commit a7db1dc into master Nov 19, 2020
@delete-merged-branch delete-merged-branch bot deleted the brawner/rclcpp_lifecycle-benchmarks branch November 19, 2020 02:41
brawner added a commit that referenced this pull request Nov 19, 2020
* Benchmark lifecycle features

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Cleanup

Signed-off-by: Stephen Brawner <brawner@gmail.com>
brawner added a commit that referenced this pull request Nov 23, 2020
* Benchmark lifecycle features

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Cleanup

Signed-off-by: Stephen Brawner <brawner@gmail.com>
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