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

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 9 06:20:54 PST 2015


On Fri, 09 Jan 2015 14:11:49 +0000
Robert burner Schadek via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:

> 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.
heh. regexps *are* fast enough. it's hard to beat well-optimised
generated thingy on a complex grammar. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150109/e8987532/attachment.sig>


More information about the Digitalmars-d-learn mailing list