[issue40496] re.findall() takes a long time (100% cup usage) on Python 3.6.10

2020-05-04 Thread Sergio Rael
Sergio Rael added the comment: Sorry, this is not a deadlock. Python puts the CPU to 100% of usage, but it takes so long that a I didn't know if it can finish the task. -- title: re.findall() deadlock on Python 3.6.10 -> re.findall() takes a long time (100% cup usage) on Python 3.6.1

[issue40496] re.findall() takes a long time (100% cup usage) on Python 3.6.10

2020-05-04 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I don't think this is a deadlock rather it is certainly related to the number of '*' there is in your pattern, the regexp has to search an exponentially growing number of patterns. You could try a simple pattern to match your attribute and it should be faster.

[issue40496] re.findall() takes a long time (100% cup usage) on Python 3.6.10

2020-05-05 Thread Sergio Rael
Sergio Rael added the comment: Thank you for your reply Rémi. I agree with you that the reason can be that the pattern is too complex. I just noticed that in Python 3.7 using the same pattern finish the searchall almost instantaneously, but in 3.6 the CPU goes to 100% and it takes ages to fin

[issue40496] re.findall() takes a long time (100% cup usage) on Python 3.6.10

2020-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is hard to say what is the problem, but seems it was solved in 3.7. Either it was an optimization, or a bug fix which had such side effect. If it was a bug fix, it was one of backward incompatible bugfixes which are not backported to older versions. --