June 14, 2004
ACL Now 30% More Expressive

Craig Norvell of Franz let me know that ACL has a new regular expression API that is “up to 30% faster than Perl.”

A new fast, Perl-compatible regular expression matcher is now available as a patch to 6.2 and 7.0.beta. The following bullets describe some of the features of the new matcher.

  • The new matcher uses Perl syntax, and is nearly feature compatible with Perl. Only a few obscure features have not been implemented.
  • Speed: the new matcher was designed to be fast. On the CL-PPCRE test suite (with 1600+ tests) it is on average 30% faster than Perl.
  • Regular expressions can use the Unicode character set (UCS-2).
  • Named capture for submatches. For example, (match-re "(?<foo>ab)\\k<foo>\\k<foo>" "aabababa") returns the values t, "ababab", and "ab".

The new regular expression module, :regexp2, is modeled on the original regular expression API, using similar symbol names (thus, for example, old: compile-regexp, new compile-re). The symbols naming functions in the new API are in the excl package, just as those in original API are. Both modules can be loaded into the same running Lisp and used independently.

Both APIs are fully documented.

Posted by jjwiseman at June 14, 2004 11:16 AM
Comments

What does "it is on average 30% faster than Perl" mean? That the test suite ran to completion in 70% of the time of the Perl tests? In which case this will be dominated by one or two long-running tests. That the average relative time in each test was 70%? In this case it will be dominated by one or two large relative differences (and is a particularly bogus measure, let us note, if the average is the mean and not the geometric mean).

A little more care with statistics, please!

Posted by: Christophe Rhodes on June 14, 2004 01:59 PM

The test suite ran in 70% of the time in ACL as it did in Perl. The times for tests run from 1 to 3 seconds, and there are 1600+ of them.

I'll be happy to forward the test run output to anyone that wants. It's a little large to post here. Decode my email address in the obvious way.

Posted by: Kevin Layer on June 15, 2004 10:24 AM

I ran the tests on a FreeBSD box. Here's the summary:

Tests: 1586
Total perl time: 2283.2600 seconds
Total lisp time: 1526.8367 seconds
ratio: 0.6687

I used a fully patched ACL 6.2 and Perl 5.005_03 on i386-freebsd.

Posted by: Kevin Layer on June 15, 2004 10:47 AM
Post a comment
Name:


Email Address:


URL:




Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)

Comments:


Remember info?