[Patch] Reduce regex _M_dfs frame size
Jonathan Wakely
jwakely@redhat.com
Mon Aug 22 17:35:00 GMT 2016
On 20/08/16 03:28 -0700, Tim Shen wrote:
>I merely split _M_dfs() into small functions to see how it goes. It
>turns out to save half of the stack consumption in -O0 without
>observable performance impact.
That seems like a good improvement.
> Split _M_dfs() into smaller functions. This seems don't affect
> performance, but reduces -O0 stack consumption by half (on my
> x86_64-linux-gnu). NFC.
I don't think we need the note about performance in the changelog,
It only needs to be a description of what was changed, not why.
> * regex_executor.h: Add separate function declarations.
> * regex_executor.tcc: Split _M_dfs() into multiple handler
> functions.
Please name the new functions here, e.g.
* regex_executor.h (_M_handle_repeat, _M_handle_subexpr_begin)
(_M_handle_subexpr_end, _M_handle_line_begin_assertion)
(_M_handle_line_end_assertion, _M_handle_word_boundary)
etc. etc.
OK for trunk with the more detailed changelog entry. Thanks!
More information about the Libstdc++
mailing list