classification
Title: Performance issue using isspace() in extension module on Windows
Type: performance Stage: resolved
Components: Distutils, Windows Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Clemens, dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2020-08-20 16:30 by Clemens, last changed 2021-02-03 18:05 by steve.dower. This issue is now closed.

Files
File name Uploaded Description Edit
isspace_ext.cpp Clemens, 2020-08-20 16:31
setup.py Clemens, 2020-08-20 16:31
test.py Clemens, 2020-08-20 16:32
Messages (2)
msg375722 - (view) Author: (Clemens) Date: 2020-08-20 16:30
Function isspace() is significantly slower in extension modules in Python 3.7 or later than in Python 3.6 on Windows 10.

Python 3.6:
>python test.py
Locale: C
Set locale: C
Locale: C
Duration: 0.19718074798583984

Python 3.7:
>python test.py
Locale: C
Set locale: C
Locale: C
Duration: 2.9086477756500244

Python 3.8:
>python test.py
Locale: LC_COLLATE=C;LC_CTYPE=English_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C
Set locale: C
Locale: C
Duration: 2.99224853515625

Python 3.9.0a5:
>python test.py
Locale: LC_COLLATE=C;LC_CTYPE=English_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C
Set locale: C
Locale: C
Duration: 2.90370512008667

Building the extension module:
> python setup.py build_ext

A similar issue already exists, but I am not sure if it is the same problem since the suggested solution is about embedding Python rather then extending it: https://bugs.python.org/issue35195
msg386242 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:05
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2021-02-03 18:05:43steve.dowersetstatus: open -> closed
resolution: out of date
messages: + msg386242

stage: resolved
2020-08-20 16:32:03Clemenssetfiles: + test.py
2020-08-20 16:31:52Clemenssetfiles: + setup.py
2020-08-20 16:31:31Clemenssetfiles: + isspace_ext.cpp
2020-08-20 16:30:59Clemenscreate