Regex instantiation

Paolo Carlini paolo.carlini@oracle.com
Thu Jan 9 10:13:00 GMT 2014


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.



More information about the Libstdc++ mailing list