Skip to content

improve MessageTypeSupport performance. (backport #562)#571

Merged
ahcorde merged 1 commit intohumblefrom
mergify/bp/humble/pr-562
Mar 23, 2026
Merged

improve MessageTypeSupport performance. (backport #562)#571
ahcorde merged 1 commit intohumblefrom
mergify/bp/humble/pr-562

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Mar 20, 2026

Description

The optimization follows biodranik's suggestion from the PR review, addressing the performance issue at its source.

Removed expensive operations:

  • ❌ std::regex_replace and std::regex("__")
  • ❌ std::ostringstream string concatenation

Replaced with efficient plain string operations:

  • ✅ Simple find/replace loop to replace "__" with "::"
  • ✅ reserve() to pre-allocate exact memory needed
  • ✅ Direct string concatenation with += operator

related to #561

Is this user-facing behavior change?

No,

Did you use Generative AI?

Yes, Claude Sonnet 4.6

Additional Information


This is an automatic backport of pull request #562 done by [Mergify](https://mergify.com).

* improve MessageTypeSupport performance.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* address review comments.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit fd48d58)
@fujitatomoya
Copy link
Copy Markdown
Contributor

Pulls: #571
Gist: https://gist.githubusercontent.com/fujitatomoya/b5f59661700cf3002f7989490871a697/raw/2b1f9c112a0d10ced39cd2f5b5993bb62c5ce302/ros2.repos
BUILD args: --packages-above-and-dependencies rmw_cyclonedds_cpp --cmake-args -DRMW_IMPLEMENTATION=rmw_cyclonedds_cpp
TEST args: --packages-above rmw_cyclonedds_cpp
ROS Distro: humble
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18574

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@fujitatomoya
Copy link
Copy Markdown
Contributor

Pulls: #571
Gist: https://gist.githubusercontent.com/fujitatomoya/52d03836b7caedba4533545fb05e666b/raw/2b1f9c112a0d10ced39cd2f5b5993bb62c5ce302/ros2.repos
BUILD args: --packages-above-and-dependencies rmw_cyclonedds_cpp
TEST args: --packages-above rmw_cyclonedds_cpp
ROS Distro: humble
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18576

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit fa8831b into humble Mar 23, 2026
2 checks passed
@ahcorde ahcorde deleted the mergify/bp/humble/pr-562 branch March 23, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants