3 ms·
Luckily, perl will optimize some constant regular expressions to use Boyer-Moore. For example, if you do: $str =~ /foobarbaz/; perl sees what you want and
by rmah 16y ago
Luckily, perl will optimize some constant regular expressions to use Boyer-Moore.
For example, if you do:
$str =~ /foobarbaz/;
perl sees what you want and uses Boyer-Moore instead of a normal regex state machine.
This, and many other optimizations, is what 20 years of language development gets you.
- FooBarWidget 16y agoBut still no JIT and no threads that don't take 20 seconds to spawn on a moderately sized app. :(
- jerf 16y agoActually, in all seriousness, deeply ingrained problems is also what 20 years of development gets you. That's why it's still important to have new up and coming languages getting created. Unfortunately there is no language so perfect it can escape this fate, and I wouldn't say Perl's problems stand out particularly on that front. It's a rare language that is even around to be criticized 20 years later, they all have their issues.