# regex-performance **Repository Path**: mengning997/regex-performance ## Basic Information - **Project Name**: regex-performance - **Description**: Performance comparison of regular expression engines re2/re2-rust and rust regex. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-09-04 - **Last Updated**: 2022-09-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Rust Regex Performance ## 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: ```bash 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.: ```bash 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. ```bash ./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. You can specify a file to write the test results per expression and engine: ```bash ./src/regex_perf -f ../3200.txt -o ./results.csv ``` The test tool writes the results in a csv-compatible format.