std.regex - ctRegex

Dmitry Olshansky dmitry.olsh at gmail.com
Sat Aug 25 08:35:40 PDT 2012


On 25-Aug-12 19:17, nazriel wrote:
> Greetings.
>
> I was using ctRegex in 2.059 without any issue, but since 2.060 came out
> some problems raised.
>
Nice to know that it did work fine in 2.059 :)
As an author even I can't recall offhand if (and when) it did work fine 
w.r.t. time spent to do its unholy thing.

> First of all:
> *First read whole message before compiling*
> http://dpaste.dzfl.pl/cfb9710d - takes 8senonds to compile on 8CPU Xeon
> with 16gb RAM, freezes my local computer - same happens to other folks
> on #d

Well \w is a huge character set (see Unicode) at run-time making optimal 
bit 2-level trie out of it is okay and takes only few ms.
At CTFE though it takes a ton of RAM and up to few minutes to do so.

>
> Is it some kind of regression or my regexp is somehow corrupted?

Well there are no significant changes to std.regex that I did since 
2.058. Now the compiler is changing and so does CTFE, and so do some 
Phobos things. I recall there even was a snapshot of dmd that doesn't 
eat RAM like crazy at CTFE (maybe yours 2.059?).
Too bad I can't recall the exact commit.


-- 
Olshansky Dmitry


More information about the Digitalmars-d-learn mailing list