I profiled gen.py and found that compiling the regular expressions takes a long time.
profile_before.txt817374612 function calls (815148474 primitive calls) in 308.347 seconds
Pre-compiling the regular expressions makes it 3.7 times faster.
profile_after.txt126576412 function calls (126367374 primitive calls) in 82.795 seconds
Output results changed slightly. The change has not yet been checked.
results_diff.txt
Purpose of the pull request
gen.py
.Description about the pull request
gen.py
and found that compiling the regular expressions takes a long time. profile_before.txt817374612 function calls (815148474 primitive calls) in 308.347 seconds
126576412 function calls (126367374 primitive calls) in 82.795 seconds
Output results changed slightly. The change has not yet been checked. results_diff.txt