-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add benchmarks for rosidl_runtime_* packages #521
Conversation
Signed-off-by: Scott K Logan <logans@cottsay.net>
Hmm, as a side effect of removing the CMake variable to disable the performance tests by default, I don't think there is a mechanism for suppressing the CMake warning that comes up when the EDIT: This has been addressed. |
Signed-off-by: Scott K Logan <logans@cottsay.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The complexity result was N^2 for strings and N*log(N) for wstrings, but they had very similar performance numbers. That's a bit surprising. But the time is probably dominated by heap allocations since those grow faster super-linearly.
I've plotted the results and ran my own analysis several times, and I think the problem is that there is so much overhead relative to the part of the code that actually scales based on the size, the results end up pretty noisy. If I run the analysis on really small sizes (100-10000), the difference in performance is negligible. If I make the numbers huge, the trends start to come through, but we'll testing string copy operations on 2 MiB strings is pretty much useless in this context. I hate to say it, but the results are a lot better on my local machine. I'm seeing O(N) on all of them with an RMS closer to 5%. The EC2 machines just aren't giving us consistent enough results to run this type of analysis reliably. I think part of the blame is on the analysis itself, too. It's fitting a log(n) and n^2 curves with coefficients that are so small that they're pretty much linear anyway, but they fit the data just a little better than a straight-up linear regression. tl;dr - I think what we're doing here is so simple that the noise pretty much takes over. It's just not a good candidate for this type of test, where the overhead of calling the function in another library is about as costly as the function's algorithm. |
Tell you what. I'm going to drop the asymptotic analysis for now. Maybe I can tweak the detection algorithm to be a little more reasonable about how it chooses the result. I'll also change the range of sizes to test what we're realistically expecting to see for string conversions. (more like 8-2048 characters). It doesn't provide value to test unrealistic string sizes just to get the analysis to act how I'm expecting it to. |
Signed-off-by: Scott K Logan <logans@cottsay.net>
@ros-pull-request-builder, retest this please |
Signed-off-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Alejandro Hernández Cordero <alejandro@openrobotics.org>
Signed-off-by: Scott K Logan <logans@cottsay.net>
There isn't any interesting data here, and we aren't expecting the performance to regress based on the size alone. I'm using an `Arg` instead of hard-coding the size so that the test name reflects that size, which should make it easier to compare results should we decide to change it the size someday. Signed-off-by: Scott K Logan <logans@cottsay.net>
Co-authored-by: Alejandro Hernández Cordero <alejandro@openrobotics.org> Signed-off-by: Alejandro Hernández Cordero <alejandro@openrobotics.org> Signed-off-by: Scott K Logan <logans@cottsay.net>
Co-authored-by: Alejandro Hernández Cordero <alejandro@openrobotics.org> Signed-off-by: Alejandro Hernández Cordero <alejandro@openrobotics.org> Signed-off-by: Scott K Logan <logans@cottsay.net>
This should not be merged before ros2/ros_buildfarm_config#119 or ros2/ci#512The PR build will fail until ament/ament_cmake#276 is released
With
-DAMENT_RUN_PERFORMANCE_TESTS=ON
:This demonstrates that in a typical build, performance tests will be skipped, but the executables are still built on all platforms.
With the flag set to enable the tests, they are run on platforms which support the
osrf_testing_tools_cpp
memory tools, and platforms which don't support the memory tools get a build warning and the tests are skipped.Performance test output: