Why do the same work about 'IndexOfAny' and 'indexOf' function?

Robert burner Schadek via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 9 06:11:49 PST 2015


On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via 
Digitalmars-d-learn wrote:

> std.regex can use CTFE to compile regular expressions (yet it 
> sometimes
> slower than non-CTFE variant), and i mean that we compile 
> regexp before
> doing alot of searches, not before each single search. if you 
> have alot
> of words to match or alot of strings to check, regexp can give 
> a huge
> boost.
>
> sure, it all depends of code patterns.

even with CTFE regex still uses a state machine _mm256_cmpeq_epi8 
will beat that even for multiple strings. Basically all lexer are 
handwritten, if regex where fast enough nobody would do the work.


More information about the Digitalmars-d-learn mailing list