![](https://secure.gravatar.com/avatar/2231bcbc9dad0f3b50c43ca75d6a4137.jpg?s=120&d=mm&r=g)
Feb. 17, 2022
11:52 p.m.
And unfortunately it does appear that my app took an almost a 20% performance hit from using regex instead of re, unfortunately. Processing time for a test dataset with 700MB of logs went from 77 seconds with the standard library re to 92 seconds with regex. Profiling confirms that the time spent in the groupdict method went from 3.27% to 9.41% and the time spent in match went from 5.19 to 10.33% of the execution time. So this means switching to regex is probably a no go. If hanging regexes become a common occurrence for my app I might decide it's worth the performance hit in the name of safety, but at this point I would rather not.