-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Performance regression in shlex.quote from 3.13 to 3.14 #146385
Copy link
Copy link
Open
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Bug description:
#132036 included an algorithmic change to
shlex.quotethat made it slower when the input has to be quoted. This is because the regular expression search was able to short-circuit at the first unsafe character.However, the
isasciicheck is worthwhileCc @picnixz
sample output:
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
reto detect shlex.quote slow path #146408