On Fri, 09 Jan 2015 14:11:49 +0000 Robert burner Schadek via Digitalmars-d-learn <digitalmars-d-learn@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. ;-)
signature.asc
Description: PGP signature