Message245137
The addition of a capturing group in a re.split() pattern, e.g. using '(\n)' instead of '\n', causes a factor of 10 performance degradation.
I use re.split a() lot, but never noticed the issue before. It was extremely noticeable on 1000 patterns in a 5BG file, though, requiring 40 seconds instead of 4.
I have attached a script demonstrating the issue. I have tested on 2.7 and 3.4, but have no reason to believe it doesn't exist on other vesions as well.
Thanks,
Pat |
|
Date |
User |
Action |
Args |
2015-06-10 18:53:09 | Patrick Maupin | set | recipients:
+ Patrick Maupin, ezio.melotti, mrabarnett |
2015-06-10 18:53:09 | Patrick Maupin | set | messageid: <1433962389.05.0.538082969488.issue24426@psf.upfronthosting.co.za> |
2015-06-10 18:53:08 | Patrick Maupin | link | issue24426 messages |
2015-06-10 18:53:08 | Patrick Maupin | create | |
|