-
Notifications
You must be signed in to change notification settings - Fork 13
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
Speedup conversion of arrays and numpy arrays #29
base: rolling
Are you sure you want to change the base?
Conversation
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.
Thank you for the PR! That's an exciting speedup! I have two requests:
- Please sign off the commits (
git rebase --signoff
) so the DCO check passes - Please fix the 7 test failures https://build.ros2.org/job/Rpr__rosidl_runtime_py__ubuntu_noble_amd64/4/testReport/
rosidl_runtime_py/convert.py
Outdated
@@ -196,52 +196,54 @@ def _convert_value( | |||
value, | |||
*, | |||
field_type=None, | |||
truncate_length=None, | |||
truncate_len=None, |
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.
Please keep this argument name as truncate_length
. This appears to be the cause of some of the test failures.
The `_convert_value` function takes a lot of time converting array types, especially making conversion of image types very slow. This change accelerates this conversion when the complete images are handled (`no_arr` option is off, no truncation applied). Signed-off-by: Zoltan Beck <[email protected]>
Signed-off-by: Zoltan Beck <[email protected]>
This reverts commit 6e9c991. Signed-off-by: Zoltan Beck <[email protected]>
Signed-off-by: Zoltan Beck <[email protected]>
3aeeed0
to
2dbc7b1
Compare
Sorry for the delay. Looks like I managed to make the checks green. |
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.
lgtm with green CI
Pulls: #29 |
The
_convert_value
function takes a lot of time converting array types, especially making conversion of image types very slow. This change accelerates this conversion when the complete images are handled (no_arr
option is off, no truncation applied).Example for speedup:
The conversion time went down for a compressed image of 256 bytes more than 10 folds, with possibly higher gains at reasonable image sizes.