This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Optimize _BFSExecutor in regex


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]