Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Perl is indeed written in C (and in Perl, I suppose).</p> <p>C has no string matching ability, so it can't possibly be slower (or faster) than Perl's. Sure, you can write a string matching library in C and compare it to string matching in Perl, but you can't compare C's since C doesn't have one.</p> <hr> <p>demerphq (one's of Perl's regex engine gurus) recently replied to "What is the speed (I won't define that) of P5 RE vs other RE in other languages?" with the following:</p> <blockquote> <p>This is a tricky question. My general experience is that some regex engines match faster for some patterns, but that many regex engines <em>fail</em> to match slower, often much slower and that in practice perls engine is competitive or superior to many other engines. So you have to be really careful with benchmarks on this, many only look at a success cases, which Perl often is slower at. This is a deliberate design decision, in many scenarios pattern fail to match more often than they match, and generally we try to fail fast.</p> <p>Another subject that makes this kind of comparison tricky is that Perls regex engine has a very rich feature set and other engines often trade features for performance. Perls regex engine has very good unicode support, support that you will often find is not supported by other engines (often this is despite their claims.)</p> <p>An example of this kind of stuff is the "mandatory substring" logic that Perl uses. The engine will find the longest string in the pattern that must be present for the pattern to match. We then use Fast-Boyer-Moore (FBM) matching to determine if the string exists. If it does not then we never start the regex engine. This means that in theory Perl can reject a pattern significantly faster than a true DFA could, and that in practice it often does so. A DFA typically needs to do N operations for a string of length N, FBM can do best case N/L inspections, where N is the number of characters and L is the length of the mandatory string.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload