Bye bye, fast compilation times

rikki cattermole rikki at cattermole.co.nz
Tue Feb 6 04:45:40 UTC 2018


On 06/02/2018 4:35 AM, Steven Schveighoffer wrote:
> 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

On that note, we really should remove it performance-aside, you cannot 
really trust it.


More information about the Digitalmars-d mailing list