This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Possible slowdown of regex searching in 3.11
Type: performance Stage:
Components: Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Dennis Sweeney, Mark.Shannon, malin, serhiy.storchaka
Priority: normal Keywords: 3.11regression

Created on 2022-04-07 11:30 by Mark.Shannon, last changed 2022-04-11 14:59 by admin.

Messages (4)
msg416923 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-04-07 11:30
The 3 regular expression benchmarks in the pyperformance suite, regex_v8, regex_effbot and regex_dna show slowdowns between 3% and 10%.

Looking at the stats, nothing seems wrong with specialization or the memory optimizations.

Which strongly suggests a regression in the sre module itself, but I can't say so for certain.
msg416928 - (view) Author: Ma Lin (malin) * Date: 2022-04-07 14:21
Could you give the two versions? I will do a git bisect.

I tested 356997c~1 and 356997c [1], msvc2022 non-pgo release build:

# regex_dna ###
an +- std dev: 151 ms +- 1 ms -> 152 ms +- 1 ms: 1.01x slower
t significant

# regex_effbot ###
an +- std dev: 2.47 ms +- 0.01 ms -> 2.46 ms +- 0.02 ms: 1.00x faster
t significant

# regex_v8 ###
an +- std dev: 21.7 ms +- 0.1 ms -> 22.4 ms +- 0.1 ms: 1.03x slower
gnificant (t=-30.82)

https://github.com/python/cpython/commit/356997cccc21a3391175d20e9ef03d434675b496
msg416959 - (view) Author: Dennis Sweeney (Dennis Sweeney) * (Python committer) Date: 2022-04-08 06:04
Possibly related to the new atomic grouping support from GH-31982?
msg416961 - (view) Author: Ma Lin (malin) * Date: 2022-04-08 07:22
> Possibly related to the new atomic grouping support from GH-31982?

It seems not likely.
I will do some benchmarks for this issue, more information (version/platform) is welcome.
History
Date User Action Args
2022-04-11 14:59:58adminsetgithub: 91404
2022-04-08 07:22:53malinsetmessages: + msg416961
2022-04-08 06:04:50Dennis Sweeneysetnosy: + Dennis Sweeney, serhiy.storchaka
messages: + msg416959
2022-04-07 14:21:03malinsetnosy: + malin
messages: + msg416928
2022-04-07 11:30:33Mark.Shannoncreate