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 12:12:06 +0100
- Subject: Re: [Patch] Optimize _BFSExecutor in regex
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifDkH0sC3FwfUrWC4Nb3h6GYsCUTvdmrgf_+UN1ZfmJwrsw at mail dot gmail dot com>
On 6 October 2013 23:43, Tim Shen wrote:
> Here's a simple piece of code
> https://gist.github.com/innocentim/6849759 the reveals _BFSExecutor's
> inefficiency. Some optimizations are here to reduce the unecessary
> time complexity from O(n^2) to O(n).
> I'll do a bootstrap and full testing before committing.
In the ChangeLog, please fix the spelling of "unnecessary".
The constructor of _TodoList could be "explicit"
Does _TodoList really need to derive from std::vector<_StateIdT> or
could it just have a second member? I think there's no benefit to
using inheritance here.
_TodoList::__exists should be named _M_exists to follow the library
Shouldn't _TodoList::_M_empty() also set __exists[n] = false for all n?
I think it's guaranteed that __exists[__u] is always in range, right?