[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

Steve:
> I strongly disagree. If CI needs to be faster, please just change the CI 
> configuration. If contributors have to wait a few minutes longer, they can 
> wait - they'll save that time in local compilations.
> Local debugging absolutely relies on debug builds. You'd be destroying the 
> workflow of most Windows-based developers with this change. It's not worth it.

Ok, I reject my issue.

I found a portable way to fix bpo-44348: it doesn't depend on the OS, nor the 
compiler, nor compiler options. The fix is to use the trashcan mecanism in the 
BaseException deallocator: commit fb305092a5d7894b41f122c1a1117b3abf4c567e.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread Dong-hee Na


Change by Dong-hee Na :


--
Removed message: https://bugs.python.org/msg401202

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread Dong-hee Na


Dong-hee Na  added the comment:

I sent the patch for this issue: https://github.com/python/mypy/pull/11067

--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread Steve Dower


Steve Dower  added the comment:

I strongly disagree. If CI needs to be faster, please just change the CI 
configuration. If contributors have to wait a few minutes longer, they can wait 
- they'll save that time in local compilations.

Local debugging absolutely relies on debug builds. You'd be destroying the 
workflow of most Windows-based developers with this change. It's not worth it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread STINNER Victor


STINNER Victor  added the comment:

I recently documented the "Python debug build":
https://docs.python.org/dev/using/configure.html#python-debug-build

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +26610
pull_request: https://github.com/python/cpython/pull/28128

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread STINNER Victor


STINNER Victor  added the comment:

This change is motivated by my PR 28128 which converts the Py_TYPE() macro to a 
static inline function. The problem is that by default, MSC disables inlining 
and test_exceptions does crash with a stack overflow, since my change increases 
the usage of the stack memory: see bpo-44348.

By the problem is wider than just Py_TYPE().

See also bpo-45094: "Consider using __forceinline and 
__attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) 
for debug builds".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +26609
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28181

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45115] Windows: enable compiler optimizations when building Python in debug mode

2021-09-06 Thread STINNER Victor


New submission from STINNER Victor :

The Visual Studio project of Python, PCBuild\ directory, disables compiler 
optimizations when Python is built in debug mode. It seems to be the default in 
Visual Studio.

Disabling compiler optimizations cause two kinds of issues:

* It increases the stack memory: tests using a deep call stack are more likely 
to crash (test_pickle, test_marshal, test_exceptions).

* Running the Python test suite take 19 min 41 sec instead of 12 min 19 sec on 
Windows x64: 1.6x slower. Because of that, we cannot use a debug build in the 
GitHub Action pre-commit CI, and we miss bugs which are catched "too late", in 
Windows buildbots. See my latest attempt to use a debug build in GitHub 
Actions: https://github.com/python/cpython/pull/24914

Example of test_marshal:

# The max stack depth should match the value in Python/marshal.c.
# BUG: https://bugs.python.org/issue33720
# Windows always limits the maximum depth on release and debug builds
#if os.name == 'nt' and hasattr(sys, 'gettotalrefcount'):
if os.name == 'nt':
MAX_MARSHAL_STACK_DEPTH = 1000
else:
MAX_MARSHAL_STACK_DEPTH = 2000

I propose to only change the compiler options for the pythoncore project which 
builds most important files for the Python "core". See attached PR.

--
components: Windows
messages: 401141
nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Windows: enable compiler optimizations when building Python in debug mode
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com