Benchmark of different python regexp libraries on some edge cases
- Environment variable
RUNS
specifies number of runs for each call.- Recommended value is 11.
- Some libraries requires extra system libraries to be installed.
- I recommend Podman/Docker
- Podman allows to run container in rootless mode with no effort.
Recommended variant to "just run on my machine"
docker run --rm -v $(pwd)/docker-out:/app/graphs -e RUNS=11 ghcr.io/alekseylobanov/regexp-performance:latest python measure_performance.py
Result images will be placed in ./docker-out
directory.
docker build -t re-benchmark .
docker run --rm -v $(pwd)/docker-out:/app/graphs -e RUNS=11 re-benchmark python measure_performance.py
Recommended variant if local building is preferred.
Result images will be placed in ./docker-out
directory.
NB: Additional libraries may be required.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
RUNS=11 python measure_performance.py
Result images will be placed in ./graphs
directory.