Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-29 Thread Tim Shen
On Tue, Apr 29, 2014 at 1:25 PM, Paolo Carlini wrote: > .. are we going to add some of these (micro-)benchmarks to the performance > testsuite, yes? ;) I think the wregex one is great :) -- Regards, Tim Shen

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-29 Thread Paolo Carlini
.. are we going to add some of these (micro-)benchmarks to the performance testsuite, yes? ;) Paolo.

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-29 Thread Jonathan Wakely
On 29/04/14 12:54 -0400, Tim Shen wrote: On Tue, Apr 29, 2014 at 6:17 AM, Jonathan Wakely wrote: This runs much faster on trunk than with 4.9.0, so we might want to backport your recent patches to the gcc-4_9-branch. It's faster but nothing to do with optimization. It's because my first patch

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-29 Thread Tim Shen
On Tue, Apr 29, 2014 at 6:17 AM, Jonathan Wakely wrote: > This runs much faster on trunk than with 4.9.0, so we might want to > backport your recent patches to the gcc-4_9-branch. It's faster but nothing to do with optimization. It's because my first patch set the DFS approach by default, which i

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-29 Thread Jonathan Wakely
On 28/04/14 17:14 -0400, Tim Shen wrote: On Mon, Apr 28, 2014 at 4:18 PM, Jonathan Wakely wrote: I thought I'd make a 5x speedup to the run-time of the regex matching, but I was comparing the wrong version and the improvement actually came from one of your patches yesterday - maybe this one: ht

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Tim Shen
On Mon, Apr 28, 2014 at 4:18 PM, Jonathan Wakely wrote: > I thought I'd make a 5x speedup to the run-time of the regex matching, > but I was comparing the wrong version and the improvement actually > came from one of your patches yesterday - maybe this one: > http://gcc.gnu.org/ml/gcc-patches/2014

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Jonathan Wakely
I thought I'd make a 5x speedup to the run-time of the regex matching, but I was comparing the wrong version and the improvement actually came from one of your patches yesterday - maybe this one: http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01725.html Nice work! My changes don't seem to make any

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Tim Shen
On Mon, Apr 28, 2014 at 3:29 PM, Jonathan Wakely wrote: > I'm testing the attached patch now. It compiles slightly faster > (-ftime-report shows, as expected, that less time is spent in template > instantiation). > > I'd also like to change __match_mode from a bool to an enum like: > > enum _Mat

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Jonathan Wakely
On 28/04/14 15:24 -0400, Tim Shen wrote: Worth a try. Will you make the change or will I? It seems to be simpler doing than talking. Yes :-) I'm testing the attached patch now. It compiles slightly faster (-ftime-report shows, as expected, that less time is spent in template instantiation). I

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Tim Shen
On Mon, Apr 28, 2014 at 3:10 PM, Jonathan Wakely wrote: > Data members are accessed through the 'this' pointer, which can > require an indirection and be harder to optimise than a function > parameter. It doesn't matter if this variable is not frequently checked. But let's just use the function p

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Jonathan Wakely
On 28/04/14 15:02 -0400, Tim Shen wrote: If we want to change it to a runtime flag, it should be a class member. Otherwise we have to pass it as a function parameter all the time, and it may waste an instruction and one byte per recursive call. It surely make the code cleaner. Data members are

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Tim Shen
On Mon, Apr 28, 2014 at 12:51 PM, Jonathan Wakely wrote: > The next thing I plan to look at, which I haven't done yet, is to see > if passing the __match_mode template parameter as a runtime function > parameter makes any difference to the way the code is structuted. Do > you have any thoughts in

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Jonathan Wakely
On 28/04/14 11:40 -0400, Tim Shen wrote: On Mon, Apr 28, 2014 at 10:46 AM, Jonathan Wakely wrote: This change splits _Executor::_M_main() into two overloaded _M_main_dispatch() functions, choosing which to run based on the __dfs_mode template parameter. I think this gives a (very) small improv

Re: [patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Tim Shen
On Mon, Apr 28, 2014 at 10:46 AM, Jonathan Wakely wrote: > This change splits _Executor::_M_main() into two overloaded > _M_main_dispatch() functions, choosing which to run based on the > __dfs_mode template parameter. > > I think this gives a (very) small improvement in compilation time when > us

[patch 3/N] std::regex refactoring - _Executor DFS / BFS

2014-04-28 Thread Jonathan Wakely
This change splits _Executor::_M_main() into two overloaded _M_main_dispatch() functions, choosing which to run based on the __dfs_mode template parameter. I think this gives a (very) small improvement in compilation time when using regexes. Splitting _M_main() allows the _M_match_queue and _M_v