Message390417
For a regex has polynomial worst-case complexity, limiting the maximum input length is indeed a very effective method.
As shown below, as the input length becomes smaller, the matching time becomes significantly smaller.
header = '' + ',' * (10 ** 4) 1.617s
header = '' + ',' * (10 ** 3) 0.014s
header = '' + ',' * (10 ** 2) 0.00017s |
|
Date |
User |
Action |
Args |
2021-04-07 11:14:28 | yetingli | set | recipients:
+ yetingli, orsenthil, vstinner, serhiy.storchaka |
2021-04-07 11:14:28 | yetingli | set | messageid: <1617794068.06.0.95738793285.issue43075@roundup.psfhosted.org> |
2021-04-07 11:14:28 | yetingli | link | issue43075 messages |
2021-04-07 11:14:28 | yetingli | create | |
|