## 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.

agrep | 1
awk | 1
ed | 1
tcl | 1
tclglob | 1
grep | 1
lua | 1
gawk | 1
sed | 1
mawk | 1
nawk | 2
egrep | 3
fgrep | 3
javascript | 3
ruby | 4
euphoria | 4
icon | 6
guile | 7
python | 8
rebol | 9
emacs | 15
perl | 16
pike | 35
java | 37

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