Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Common Lisp have the fastest PCRE implementation?

A friend claimed that Common Lisp has the fastest Perl-compatible regular expression library of any language, including Perl itself, because with an optimizing JIT compiler like SBCL, CL-PPCRE can compile each particular regex down to native assembly whereas other implementations, include Perl's, must generate bytecode and interpret it. In practice, especially for the common case where we try to match the same regex against many inputs or long input, the compilation overhead is more than justified.

Unfortunately, I can't find any benchmarks on this, and I don't know enough to run my own, so I turn to the hive mind. Can anyone evaluate this claim?

like image 955
Wang Avatar asked Feb 21 '11 08:02

Wang


People also ask

Is Common Lisp faster than C?

At 25000 values, Common Lisp is 4.1 times as fast as the C version, and the compilation time is 88% of the total evaluation time. The actual numbers obtained by this experiment are ob- viously both implementation and problem dependent. It should be possible, however, to draw some generic qualita- tive conclusions.

Is Sbcl fast?

SBCL is now faster than Java, as fast as Ocaml, and getting better.

What PCRE Perl Compatible Regular Expressions matching does?

The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API.


1 Answers

I have no benchmarks of my own to share, but perhaps your friend was referring to results concerning the portable regular expression library CL-PPCRE. The current web page no longer speaks of benchmarks, but courtesy of the Wayback Machine we can see that it used to show benchmark results where CL-PPCRE outperformed Perl 2-to-1. Benchmarking is a tricky business (especially for moving targets), which might explain why the current page is silent on the matter.

like image 153
WReach Avatar answered Sep 18 '22 23:09

WReach