Speedup conversion of arrays and numpy arrays#29
Open
beckzoli wants to merge 4 commits intoros2:rollingfrom
Open
Speedup conversion of arrays and numpy arrays#29beckzoli wants to merge 4 commits intoros2:rollingfrom
beckzoli wants to merge 4 commits intoros2:rollingfrom
Conversation
sloretz
requested changes
Oct 29, 2024
sloretz
left a comment
There was a problem hiding this comment.
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
| *, | ||
| field_type=None, | ||
| truncate_length=None, | ||
| truncate_len=None, |
There was a problem hiding this comment.
Please keep this argument name as truncate_length. This appears to be the cause of some of the test failures.
added 4 commits
December 6, 2024 14:11
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 <zoltan.beck@woven.toyota>
This reverts commit 6e9c991. Signed-off-by: Zoltan Beck <zoltan.beck@woven.toyota>
Signed-off-by: Zoltan Beck <zoltan.beck@woven.toyota>
3aeeed0 to
2dbc7b1
Compare
Author
|
Sorry for the delay. Looks like I managed to make the checks green. |
Contributor
|
Pulls: #29 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
_convert_valuefunction 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_arroption 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.