Skip to content

perf(system/autoware_diagnostic_graph_aggregator): use emplace/emplace_back to avoid temporary object creation#12239

Merged
nishikawa-masaki merged 6 commits intoautowarefoundation:mainfrom
nishikawa-masaki:perf/optimize-emplace-usage-system
Apr 13, 2026
Merged

perf(system/autoware_diagnostic_graph_aggregator): use emplace/emplace_back to avoid temporary object creation#12239
nishikawa-masaki merged 6 commits intoautowarefoundation:mainfrom
nishikawa-masaki:perf/optimize-emplace-usage-system

Conversation

@nishikawa-masaki
Copy link
Copy Markdown
Contributor

@nishikawa-masaki nishikawa-masaki commented Mar 4, 2026

Description

This PR optimizes STL container usage in the system directory to reduce temporary object creation, improving runtime performance and reducing memory overhead.

Key changes:

  • Replaced vec.push_back(Type(args...)) with vec.emplace_back(args...) to construct objects in-place.
  • Replaced map.insert(std::make_pair(k, v)) with map.emplace(k, v) to avoid std::pair temporary creation.

Affected packages:

  • system/autoware_diagnostic_graph_aggregator

Related links

Parent Issue:

  • None

Private Links:

How was this PR tested?

  • Compiles successfully.
  • The unit tests succeed.
  • The changes are refactoring-only and should not alter logic.

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

…e_back to avoid temporary object creation

Signed-off-by: nishikawa-masaki <masaki.nishikawa@tier4.jp>
@github-actions github-actions bot added the component:system System design and integration. (auto-assigned) label Mar 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@nishikawa-masaki nishikawa-masaki added type:arm64 ARM64 architecture issues or compatibility. type:performance Software optimization and system performance. run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) labels Mar 4, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.96%. Comparing base (6f4e694) to head (b8757c7).

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     
Flag Coverage Δ *Carryforward flag
daily 21.01% <ø> (+<0.01%) ⬆️ Carriedforward from d799ddd
daily-cuda 18.56% <ø> (+<0.01%) ⬆️ Carriedforward from d799ddd
daily-humble-amd64-cuda 18.35% <ø> (-0.01%) ⬇️ Carriedforward from d799ddd
daily-humble-amd64-nocuda 20.87% <ø> (+<0.01%) ⬆️ Carriedforward from d799ddd
differential 3.02% <100.00%> (?)
total-cuda 18.56% <ø> (+<0.01%) ⬆️ Carriedforward from d799ddd
total-humble-cuda 18.35% <ø> (+<0.01%) ⬆️ Carriedforward from d799ddd

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nishikawa-masaki nishikawa-masaki marked this pull request as ready for review March 4, 2026 11:04
@nishikawa-masaki nishikawa-masaki self-assigned this Mar 26, 2026
@nishikawa-masaki nishikawa-masaki merged commit d961154 into autowarefoundation:main Apr 13, 2026
33 checks passed
@github-project-automation github-project-automation bot moved this from To Triage to Done in Software Working Group Apr 13, 2026
@nishikawa-masaki nishikawa-masaki deleted the perf/optimize-emplace-usage-system branch April 13, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:system System design and integration. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:arm64 ARM64 architecture issues or compatibility. type:performance Software optimization and system performance.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants