Landing: dc65d88cdf15

Project / Subsystem

gcc / libstdc++

Date

2026-09-22

Author

Tamar Christina

Commit

dc65d88cdf15f3538fdcfd1d174c845474989533

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
libstdc++
patch_id
—
commit_hash
dc65d88cdf15f3538fdcfd1d174c845474989533
source_type
github
headline
libstdc++: Continue with regex DFS traversals without next frames
tldr
Optimized regex DFS execution in libstdc++ by avoiding unnecessary stack frame operations for repeated matches.
author
Tamar Christina
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • libstdc++
  • • regex
  • • optimization
  • • performance
discussion_id_link
—
bugzilla_pr
—
date
2026-09-22T00:00:00.000Z

This patch revises the iterative DFS regex executor to avoid pushing and popping stack frames when a match is expected to continue. For repeated subexpressions, the executor now attempts to consume the state immediately, keeping values in registers to minimize memory accesses and function call overhead. This significantly improves performance for patterns involving repetitions, while maintaining the memory usage improvements of the original iterative approach.