This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] Regex bracket matcher cache optimization
- From: Tim Shen <timshen91 at gmail dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 8 Jan 2014 17:11:28 -0500
- Subject: Re: [Patch] Regex bracket matcher cache optimization
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifDnXTpH6K2A6O41OOx34AVMKKm=-gXPh7J0Sjq9=9rM8+g at mail dot gmail dot com> <CAPrifDkC0iSROtATApvp4_h9Je1S7XcahUBnOzK9g4ZdgYsBEg at mail dot gmail dot com> <52CBC2C1 dot 6060908 at oracle dot com> <CAPrifDkATveVCsq0RFn-6VadkOgEjOiKV-LYWGgy5tZg0MxSyA at mail dot gmail dot com> <CAH6eHdSkRPbeLE_ZG41LvtxA=7CpPzq=i3OeCb-JJHrp-Xqkvw at mail dot gmail dot com> <52CD2683 dot 1040104 at oracle dot com>
On Wed, Jan 8, 2014 at 5:20 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> On 01/08/2014 10:24 AM, Jonathan Wakely wrote:
>> Ouch! Yes, that's quite a bit slower, and this code is already very
>> slow to compile.
With this patch (who is based on a-fixed.diff, committed earlerly),
who use templated member functions instead of templating the whole
_Compiler, time consumption is:
g++ -g -Wall -std=c++11 -g -Wall -std=c++11 -O3 regextest.cc 3.79s
user 0.14s system 98% cpu 3.981 total
Comparing to 4.5s it's better and probably fine.
Booted and tested with -m32 and -m64 respectively.
> I only want to add that, besides keeping compile-time under control for
> 4.9.0 - please investigate a bit more along the mentioned lines - we should
> also start experimenting with exporting the instantiations. I don't know
> what the other implementations are doing, but in general it definitely makes
> sense, for compile-time performance too. I think we already said that some
> time ago, but the issue seems more important now. Maybe it's really
> unavoidable if we need template complexity for first class run-time
> performance.
After this patch I plan to instantiate _Compiler and _Executor.
--
Regards,
Tim Shen