[Patch] Optimize _BFSExecutor in regex

Tim Shen timshen91@gmail.com
Tue Oct 8 00:06:00 GMT 2013


On Mon, Oct 7, 2013 at 7:11 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> The version in your gist (which is *not* what your first patch did!)
> is faster for any size of _M_exists and any ratio of _M_states.size()
> / _M_exists.size():

Sorry for my original patch, I made a mistake! It's:
      while (!_BaseT::empty())
        _BaseT::pop_back();
but I truely meant:
      while (!this->_M_empty())
        this->_M_pop();
To make all trues reset.

In my machine the while loop is slower than assign() when the
_M_states.size() / _M_exists.size() is more than even 7/1000. so let's
keep the assign(), because the ratio in regex could probably be more
than 25%.


-- 
Tim Shen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.patch
Type: application/octet-stream
Size: 13808 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20131008/76d29218/attachment.obj>


More information about the Libstdc++ mailing list