perf(system/autoware_diagnostic_graph_aggregator): use emplace/emplace_back to avoid temporary object creation#12239
Merged
nishikawa-masaki merged 6 commits intoautowarefoundation:mainfrom Apr 13, 2026
Conversation
…e_back to avoid temporary object creation Signed-off-by: nishikawa-masaki <masaki.nishikawa@tier4.jp>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12239 +/- ##
==========================================
+ Coverage 18.49% 18.96% +0.46%
==========================================
Files 1855 1892 +37
Lines 129017 130629 +1612
Branches 45872 48238 +2366
==========================================
+ Hits 23864 24773 +909
- Misses 85382 86762 +1380
+ Partials 19771 19094 -677
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
isamu-takagi
approved these changes
Apr 13, 2026
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.
Description
This PR optimizes STL container usage in the
systemdirectory to reduce temporary object creation, improving runtime performance and reducing memory overhead.Key changes:
vec.push_back(Type(args...))withvec.emplace_back(args...)to construct objects in-place.map.insert(std::make_pair(k, v))withmap.emplace(k, v)to avoidstd::pairtemporary creation.Affected packages:
system/autoware_diagnostic_graph_aggregatorRelated links
Parent Issue:
Private Links:
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.