-
Notifications
You must be signed in to change notification settings - Fork 682
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(autoware_detected_object_validation): reduce lanelet_filter processing time #8240
perf(autoware_detected_object_validation): reduce lanelet_filter processing time #8240
Conversation
Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> change to _func__ add more debug use local rtree fix tmp update fix bug clean unused clean up Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
TEST under TIER IV cloud |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8240 +/- ##
==========================================
- Coverage 29.25% 29.24% -0.01%
==========================================
Files 1600 1600
Lines 117744 117775 +31
Branches 50716 50723 +7
==========================================
Hits 34447 34447
- Misses 74072 74103 +31
Partials 9225 9225
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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! Thank you for your contribution.
I did not confirmed that the Autoware coding guideline allows to use abbreviated namespace.
namespace bg = boost::geometry;
perception/autoware_detected_object_validation/src/lanelet_filter/lanelet_filter.cpp
Outdated
Show resolved
Hide resolved
perception/autoware_detected_object_validation/src/lanelet_filter/lanelet_filter.cpp
Outdated
Show resolved
Hide resolved
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
It seems no problem because some planning code use this expression. |
The code changes in `lanelet_filter.cpp` optimize the object filtering process by using the `empty()` function instead of checking the size of the `transformed_objects.objects` vector. This change improves performance and simplifies the code logic. Refactor the code to use `empty()` instead of `size()` for checking if the `transformed_objects.objects` vector is empty. This change improves readability and performance. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
…essing time (autowarefoundation#8240) * add local r-tree for fast searching Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> change to _func__ add more debug use local rtree fix tmp update fix bug clean unused clean up Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> * clean up Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> * style(pre-commit): autofix * chore: Optimize object filtering and improve performance The code changes in `lanelet_filter.cpp` optimize the object filtering process by using the `empty()` function instead of checking the size of the `transformed_objects.objects` vector. This change improves performance and simplifies the code logic. Refactor the code to use `empty()` instead of `size()` for checking if the `transformed_objects.objects` vector is empty. This change improves readability and performance. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> --------- Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Taekjin LEE <taekjin.lee@tier4.jp>
…essing time (autowarefoundation#8240) (#1433) * add local r-tree for fast searching change to _func__ add more debug use local rtree fix tmp update fix bug clean unused clean up * clean up * style(pre-commit): autofix * chore: Optimize object filtering and improve performance The code changes in `lanelet_filter.cpp` optimize the object filtering process by using the `empty()` function instead of checking the size of the `transformed_objects.objects` vector. This change improves performance and simplifies the code logic. Refactor the code to use `empty()` instead of `size()` for checking if the `transformed_objects.objects` vector is empty. This change improves readability and performance. --------- Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…essing time (autowarefoundation#8240) * add local r-tree for fast searching Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> change to _func__ add more debug use local rtree fix tmp update fix bug clean unused clean up Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> * clean up Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> * style(pre-commit): autofix * chore: Optimize object filtering and improve performance The code changes in `lanelet_filter.cpp` optimize the object filtering process by using the `empty()` function instead of checking the size of the `transformed_objects.objects` vector. This change improves performance and simplifies the code logic. Refactor the code to use `empty()` instead of `size()` for checking if the `transformed_objects.objects` vector is empty. This change improves readability and performance. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> --------- Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com> Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Taekjin LEE <taekjin.lee@tier4.jp>
Description
This PR is for speeding up the lanelet filtering process.
This PR will reduce the number of loops by using the inner R-tree of intersected lanelets.
Using the TimeKeeper, I checked the bottleneck of lanelet filter node. The main bottleneck was the for-loop for the filtering for the objects that have no bounding box (unknown object).
processing times
Example of worst cases.
no bbox filter
is the part taking time.Before this PR
After this PR
no bbox filter: pre process
: from R-tree search to the endno bbox filter: main loop
: from for-loop checking to the endVS. previous implementations
There is no guarantee the time is matching the actual time line or correspond to each other.
original: before #8109
current: after #8109 (before this PR)
optimized: after this PR
play in x0.5
means,bag play
with rate of 0.5.mean processing time
original mean:
34.401
mscurrent mean:
30.980
msoptimized best comb. mean:
3.899
ms(mean processing time was calculated with records that have more than 1 ms)
Related links
Parent Issue:
How was this PR tested?
Processing time
Processing time was gathered from TimeKeeper: https://github.com/autowarefoundation/autoware.universe/tree/main/common/autoware_universe_utils
Degradation
Qualitative test is done by manually checking and comparing with the original implementation's detected and filtered unknown objects.
No quantitative evaluation was done.
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.