Skip to content

rust-leipzig/regex-performance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Regex Performance

Introduction

Regular expressions are commonly used in pattern search algorithms. This tool is based on the work of John Maddock (See his own regex comparison here) and the sljit project (See their regex comparison here).

Requirements

Supported engines

The following regex engines are supported and covered by the tool:

Building the tool

The different engines have different requirements which are not described here. Please see the related project documentations.

In the case all depencies are fulfilled, just configure and build the cmake based project:

mkdir build && cd build
cmake ..
make

The make command will build all engines and the test tool regex_perf.

To build the test tool or a library only, call make with corresponding target, i.e.:

make regex_perf

Usage

The test tool calls each engine with a defined set of different regular expression on a given file. The repository contains a ~16Mbyte large text file (3200.txt) which can be used for measuring.

./src/regex_perf -f ./3200.txt

By default, the tool repeats each test 5 times and prints the best time of each test. The overall time to process each regular expression is measured and accounted. The scoring algorithhm distributes the fastest engine 5 points, the second fastest 4 points and so on. The score points help to limit the impact of a slow regular expression eninge test in comparision to the absolut time value.

About

Performance comparison of regular expression engines.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8