std.regex performance

Jesse Phillips jessekphillips+D at gmail.com
Wed Feb 8 15:35:14 PST 2012


On Wednesday, 8 February 2012 at 22:21:35 UTC, David Nadlinger 
wrote:
> On 2/8/12 10:44 PM, Jesse Phillips wrote:
>> foreach(w; std.string.split(readText(name)))
>> if(!match(w, regex(r"\d")).empty)
>> {}
>> }
>
> Could it be that you are rebuilding the regex engine on every 
> iteration here?
>
> David

That is the case. The older regex apparently cached the last 
regex. will be more careful in the feature.


More information about the Digitalmars-d mailing list