This is the mail archive of the
mailing list for the GCC project.
Re: [Patch] Optimize _BFSExecutor in regex
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Tim Shen <timshen91 at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 7 Oct 2013 18:28:58 +0100
- Subject: Re: [Patch] Optimize _BFSExecutor in regex
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifDkH0sC3FwfUrWC4Nb3h6GYsCUTvdmrgf_+UN1ZfmJwrsw at mail dot gmail dot com> <CAH6eHdQjKNAzLXCoA07T7tB5HfExEFN8rCBayvP=GCS1_=BiPg at mail dot gmail dot com> <CAPrifDko9SnheJ+aQ45W5NLyK5NKHfP_-3f0pczROiXCKf8bDg at mail dot gmail dot com> <CAH6eHdS0B6wpXQdhXTbXo1PgjnuUSjfoAbK404VE+MPAya48FQ at mail dot gmail dot com> <CAPrifDk6R9wtoZNewyNpESgkx1J6YW0xJNaut0tG-ta5RJ3p+w at mail dot gmail dot com> <CAH6eHdS81ftVScJW_zhxt=gW=2g60fnHA=0O70AQr0jpB-m4ug at mail dot gmail dot com> <CAPrifDndETV=aU82C9BB0rZv=VQRwU36WxWzM09raHEoQ8gXHA at mail dot gmail dot com>
On 7 October 2013 18:12, Tim Shen <firstname.lastname@example.org> wrote:
> On Mon, Oct 7, 2013 at 12:22 PM, Jonathan Wakely <email@example.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.