pyperformance
pyperformance copied to clipboard
Create bm_regex_generic.py
Benchmarks for checking begining and end of strings. Should have reasonable times after https://bugs.python.org/issue42885 is fixed.
Real life use case is e.g. comparing 500.000 filenames and paths each with thousands of regex of known malicous files, https://github.com/Neo23x0/signature-base/blob/master/iocs/filename-iocs.txt (^ and $ mostly not yet included because it wouldn't give a speed advantage in https://github.com/Neo23x0/Loki)
Adopted from bm_regex_effbot.py by Arnim Rupp
(All the other bm_regex_* felt kind of complete so I started a new file)