Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue23445

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Use -Og for debug builds
Type:enhancementStage:resolved
Components:Build, TestsVersions:Python 3.4, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: pitrou, python-dev, serhiy.storchaka, vstinner
Priority:normalKeywords:patch

Created on2015-02-11 16:28 bypitrou, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
og.patchpitrou,2015-02-11 16:28review
Messages (11)
msg235754 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2015-02-11 16:28
Recent gcc versions have an optimization level named "-Og". It enables all optimizations that do not break debugging. Here is a patch that uses it on debug builds.Without the patch I get the following time for the whole test suite:$ time ./python -m test -j12[...]real3m51.670suser11m53.039ssys0m28.300sWith the patch it goes down to:real2m36.378suser7m13.743ssys0m29.728sSo the test suite is 33% faster to pass.
msg235755 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2015-02-11 16:44
Most slow tests are skipped without -uall.As for the patch, may be use AX_CHECK_COMPILE_FLAG [1]?[1]http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
msg235756 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2015-02-11 17:10
-uall, without patch:real5m47.290suser18m28.405ssys0m29.493s-uall, with patch:real3m35.132suser10m26.345ssys0m30.351sThat's a 38% speedup.
msg235757 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2015-02-11 17:11
> As for the patch, may be use AX_CHECK_COMPILE_FLAG [1]?It's not used elsewhere in configure.ac. I reused the idiom used a couple lines above.
msg235759 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2015-02-11 18:00
This looks pretty harmless. Some slow buildbots run tests very long time and failed with timeout after 3600 seconds. May be this patch will make them faster.Yet one advantage -- the code compiled with partial optimization will be closer to the code compiled with full optimization. Therefore debugging version could catch more bugs that exist only with optimization.But may be apply this only to 3.5?
msg235760 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2015-02-11 18:03
I'd like to apply it to 3.4 as well, because it makes development more pleasant.
msg235763 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-02-11 18:41
New changesete37b201297d2 by Antoine Pitrou in branch '3.4':Issue#23445: pydebug builds now use "gcc -Og" where possible, to make the resulting executable faster.https://hg.python.org/cpython/rev/e37b201297d2New changeset527ed5205806 by Antoine Pitrou in branch 'default':Issue#23445: pydebug builds now use "gcc -Og" where possible, to make the resulting executable faster.https://hg.python.org/cpython/rev/527ed5205806
msg235764 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2015-02-11 18:41
Done. It shouldn't break anything.
msg239406 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-03-27 14:44
New changesetc663dbb84c8c by Victor Stinner in branch '3.4':Issue#23445: Fix test.support.python_is_optimized() for CFLAGS=-Oghttps://hg.python.org/cpython/rev/c663dbb84c8cNew changeset5b5a22b9327b by Victor Stinner in branch '2.7':Issue#23445: Fix test_gdb.python_is_optimized() for CFLAGS=-Oghttps://hg.python.org/cpython/rev/5b5a22b9327b
msg239407 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2015-03-27 14:48
> Done. It shouldn't break anything.You're change skipped some test_gdb tests. I fixed the check in test_gdb/test.support.
msg353754 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-10-02 16:57
I createdbpo-38350 to propose to revert this change.
History
DateUserActionArgs
2022-04-11 14:58:12adminsetgithub: 67633
2019-10-02 16:57:46vstinnersetmessages: +msg353754
2015-03-27 14:48:51vstinnersetnosy: +vstinner
messages: +msg239407
2015-03-27 14:44:55python-devsetmessages: +msg239406
2015-02-11 18:41:42pitrousetstatus: open -> closed
resolution: fixed
messages: +msg235764

stage: patch review -> resolved
2015-02-11 18:41:20python-devsetnosy: +python-dev
messages: +msg235763
2015-02-11 18:03:00pitrousetmessages: +msg235760
2015-02-11 18:00:01serhiy.storchakasetmessages: +msg235759
2015-02-11 17:11:02pitrousetmessages: +msg235757
2015-02-11 17:10:31pitrousetmessages: +msg235756
2015-02-11 16:44:09serhiy.storchakasetnosy: +serhiy.storchaka
messages: +msg235755
2015-02-11 16:28:42pitroucreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp