Speed

The time needed for a particular operation depends on the amount of test data, the regular expression, and the program used to execute the regular expression.

Here are some rather dated timings of some the programs supported. The times are the number of seconds reported by Tcl's clock command for the execution of the 180 tests then in the test suite. Current times will generally be longer as there are now 464 tests in the test suite, though in some cases I have found ways to speed up execution. In the absence of a more recent set of benchmarks, these still give a good idea of the relative time that each program takes.

agrep1
awk1
ed1
tcl1
tclglob1
grep1
lua1
gawk1
sed1
mawk1
nawk2
egrep3
fgrep3
javascript3
ruby4
euphoria4
icon6
guile7
python8
rebol9
emacs15
perl16
pike35
java37

The execution of regular expressions by shells is comparatively slow because the test data cannot be supplied directly to the shells since they do not match regular expressions to data in files or on the command line but rather to the files in a directory. As a result, regular expression matching by shells is implemented by creating files whose names are the items of test data in a temporary directory, then executing the shell with the test directory as its current working directory. This means that quite a few child processes must be executed.

Note that the time for execution of the test suite is heavily influenced by compilation and setup time since the tests involve very small amounts of data. A program whose invocation is slow may be fast at processing a large amount of data. Pike, for example, is slow at compilation and startup but fast at regular expression matching itself.


Next

Back to Table of Contents