[Patch] Optimize _BFSExecutor in regex
Jonathan Wakely
jwakely.gcc@gmail.com
Mon Oct 7 17:29:00 GMT 2013
On 7 October 2013 18:12, Tim Shen <timshen91@gmail.com> wrote:
> On Mon, Oct 7, 2013 at 12:22 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> because that turns into the equivalent of a std::memset() on integers.
>
> Here I catch your idea. But think about the following example:
> _M_exists.size() == 1000, but only 3 of the elements are true. Now
> what I intend to do is assigning these 3 elements to false, rather
> than reseting the whole vector. Is this called "pay for what you get"?
std::memset() on about 125 bytes is not a big deal, I doubt it's
significantly more expensive than the calculations to find the right
bits and do the necessary masking for three elements.
std::vector<bool> is a strange beast, remember.
More information about the Libstdc++
mailing list