This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Regex instantiation
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Tim Shen <timshen91 at gmail dot com>, Marc Glisse <marc dot glisse at inria dot fr>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 09 Jan 2014 11:13:02 +0100
- Subject: Re: Regex instantiation
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifDnbuYcMBSwZChRz7cE6ZfhPT55YRxJ8nLDHadMKe=L-hA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1401090740190 dot 3666 at laptop-mg dot saclay dot inria dot fr> <CAPrifDmUaJayAucrHigb1231v6qdn=_mbzPpqWUTMi=z2_me=A at mail dot gmail dot com>
On 01/09/2014 10:03 AM, Tim Shen wrote:
For user code that uses things like sregex_token_iterator (triggers
_Compiler<basic_regex<char>::const_iterator>), it saves compile time:
Without any instantiation, testsuite/performance/28_regex/split.cc
cost about 5 sec to compile in my machine; with basic_string inst, it
costs 1.5 sec to compile; with pointers insts only (in this patch), it
costs 2.8 secs. But no doubt it generates larger object file.
Originally I suggested to copy the input regex into _Compiler as a
"const _CharT*", but I really saw a 3000 regex input string, which
makes the time cost of copying not negligible.
We could maybe compute the length and dispatch to two different strategies?
In any case, this is post-4.9 material, we have time to do this right.
Paolo.