-
Notifications
You must be signed in to change notification settings - Fork 15
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
perf: shallow copy instead of deepcopy #197
base: develop
Are you sure you want to change the base?
Conversation
@@ -475,7 +475,7 @@ def filter_frame_by_distance( | |||
Returns: | |||
PerceptionFrameResult: Filtered frame results. | |||
""" | |||
ret_frame = deepcopy(frame) | |||
ret_frame = copy(frame) |
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.
@ktro2828 Do you remember why you used deepcopy here?
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.
I've used deepcopy
in order to guarantee copying the all objects contained in PerceptionFrameResult
.
But I think it is OK to use copy
instead if it is OK.
I've just noticed, that there is a bug: for more than one criterion, it only returns the last one. |
@YoshiRi |
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
There is much bigger problem with this code, than i previously though. |
I hope this time I have considered all cases, however I have a request that T4 checks this PR on your data. This solution is not 2x speedup, but still it significantly shortens the processing time. |
@@ -0,0 +1,38 @@ | |||
from copy import deepcopy |
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.
I don't know what's the copyright procedure here? I could be either stackoverlow, Autonomous Systems or TIER4, or all together.
Category
What
Performance optimization, along with the changes in driving_log_replayer allows realtime processing (5x speedup) of frames processing.
Type of change
Test performed
Running the driving log replayer and...
Reference
Notes for reviewer