This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regex instantiation


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]