Bye bye, fast compilation times

Steven Schveighoffer schveiguy at yahoo.com
Tue Feb 6 04:35:42 UTC 2018


On 2/5/18 11:09 PM, psychoticRabbit wrote:
> On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote:
>>
>> Comment out the call to `regex()`, and I get:
>>
>> ------
>> real    0m0.285s
>> user    0m0.262s
>> sys     0m0.023s
>> ------
>>
> 
> regex is not the only one I avoid..
> 
> how long you think this takes to compile?
> (try ldc2 too ..just for laughs ;-)
> 
> ----
> import std.net.isemail;
> 
> void main()
> {
>      auto checkEmail = "someone at somewhere.com".isEmail();
> }
> ----

I was surprised at this, then I looked at the first line of isEmail:

     static ipRegex = 
ctRegex!(`\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}`~
 
`(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`.to!(const(Char)[]));

So it's really still related to regex.

-Steve


More information about the Digitalmars-d mailing list