Re: Poor regex performance?

2019-04-04 Thread Jon Degenhardt via Digitalmars-d-learn
On Thursday, 4 April 2019 at 10:31:43 UTC, Julian wrote: On Thursday, 4 April 2019 at 09:57:26 UTC, rikki cattermole wrote: If you need performance use ldc not dmd (assumed). LLVM has many factors better code optimizes than dmd does. Thanks! I already had dmd installed from a brief look at D

Re: Poor regex performance?

2019-04-04 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 04, 2019 at 09:53:06AM +, Julian via Digitalmars-d-learn wrote: [...] > auto re = ctRegex!(r"(?:\S+ ){3,4}<= ([^@]+@(\S+))"); [...] ctRegex is a crock; use regex() instead and it might actually work better. T -- Stop staring at me like that! It's offens... no, you'll

Re: Poor regex performance?

2019-04-04 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 4 April 2019 at 10:31:43 UTC, Julian wrote: On Thursday, 4 April 2019 at 09:57:26 UTC, rikki cattermole wrote: If you need performance use ldc not dmd (assumed). LLVM has many factors better code optimizes than dmd does. Thanks! I already had dmd installed from a brief look at D

Re: Poor regex performance?

2019-04-04 Thread Julian via Digitalmars-d-learn
On Thursday, 4 April 2019 at 09:57:26 UTC, rikki cattermole wrote: If you need performance use ldc not dmd (assumed). LLVM has many factors better code optimizes than dmd does. Thanks! I already had dmd installed from a brief look at D a long time ago, so I missed the details at

Re: Poor regex performance?

2019-04-04 Thread XavierAP via Digitalmars-d-learn
On Thursday, 4 April 2019 at 09:53:06 UTC, Julian wrote: Relatedly, how can I add custom compiler flags to rdmd, in a D script? For example, -L-lpcre Configuration variable "DFLAGS". On Windows you can specify it in the sc.ini file. On Linux: https://dlang.org/dmd-linux.html

Re: Poor regex performance?

2019-04-04 Thread rikki cattermole via Digitalmars-d-learn
If you need performance use ldc not dmd (assumed). LLVM has many factors better code optimizes than dmd does.

Poor regex performance?

2019-04-04 Thread Julian via Digitalmars-d-learn
The following code, that just runs a regex against a large exim log to report on top senders, is 140 times slower than similar C code using PCRE, when compiled with just -O. With a bunch of other flags I got it down to only 13x slower than C code that's using libc regcomp/regexec. import