This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Optimize _BFSExecutor in regex
- From: Tim Shen <timshen91 at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc 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 13:12:30 -0400
- 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>
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"?
The ideal solution could be:
void _M_clear() {
if (__exists.size() < _BaseT::size() * CPU_WORD_LENGTH * some_factor)
clear_one_by_one();
else
reset_them_all();
}
--
Tim Shen