[issue2506] Add mechanism to disable optimizations

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: In general, it is hard to define what is an optimization, and what is part of the compiler. The original request was to disable optimizations that changed observable behavior w.r.t. line numbers. All optimizations now respect line numbers, so proposed

[issue2506] Add mechanism to disable optimizations

2020-12-22 Thread Mark Shannon
Mark Shannon added the comment: I think this can finally be closed. A mere 12 years after it was opened :) PEP 626 specifies what the correct behavior is, regardless of whether optimizations are turned on or off, so there is no point in a no-optimize option. The compiler is fast enough that

[issue2506] Add mechanism to disable optimizations

2020-08-31 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +21127 pull_request: https://github.com/python/cpython/pull/22027 ___ Python tracker ___

[issue2506] Add mechanism to disable optimizations

2020-08-31 Thread Ned Batchelder
Ned Batchelder added the comment: If there is any doubt that this affects people, it was reported *again* against coverage.py today: https://github.com/nedbat/coveragepy/issues/1025 -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2020-03-11 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I will pick this up from Victor's last patch -- nosy: +pablogsal ___ Python tracker ___

[issue2506] Add mechanism to disable optimizations

2019-08-26 Thread STINNER Victor
STINNER Victor added the comment: > There are different optimizations on different levels (AST, bytecode > generation, peepholer), would be nice to control them separately. This means > that we should pass a bitset to the compiler. What's the use case for enabling some AST optimizations

[issue2506] Add mechanism to disable optimizations

2019-08-26 Thread Arthur Goldberg
Arthur Goldberg added the comment: Appreciate you working on this Serhiy and Victor! -- ___ Python tracker ___ ___ Python-bugs-list

[issue2506] Add mechanism to disable optimizations

2019-08-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are different optimizations on different levels (AST, bytecode generation, peepholer), would be nice to control them separately. This means that we should pass a bitset to the compiler. -- ___ Python

[issue2506] Add mechanism to disable optimizations

2019-05-28 Thread STINNER Victor
STINNER Victor added the comment: My PR 13600 works as expected. I simplified attached continue.py: see attached traceme.py. Output with optimizations --- $ ./python traceme.py 6 0 LOAD_CONST 1 (0) 2 STORE_FAST 0 (a) 7 4

[issue2506] Add mechanism to disable optimizations

2019-05-27 Thread STINNER Victor
STINNER Victor added the comment: I proposed PR 13600 which is based PR 9693, but more complete and up to date. -- ___ Python tracker ___

[issue2506] Add mechanism to disable optimizations

2019-05-27 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +13506 pull_request: https://github.com/python/cpython/pull/13600 ___ Python tracker ___

[issue2506] Add mechanism to disable optimizations

2019-02-07 Thread Ned Batchelder
Ned Batchelder added the comment: FWIW, Yury started a pull request: https://github.com/python/cpython/pull/9693 -- keywords: -patch ___ Python tracker ___

[issue2506] Add mechanism to disable optimizations

2019-01-08 Thread Brett Cannon
Brett Cannon added the comment: If someone can get a PR into a state that is acceptable, then this can be resolved, Arthur. But at this point that hasn't occurred. -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2019-01-07 Thread Arthur Goldberg
Arthur Goldberg added the comment: This issue is well into the 2nd decade of debate. Who has the power to effect this change? Happy New Year Arthur -- ___ Python tracker ___

[issue2506] Add mechanism to disable optimizations

2018-10-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that disabling bytecode optimizations will not help to solve other problems with the coverity tool in 3.8: issue34705 and issue34876. -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2018-10-03 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +9080 stage: -> patch review ___ Python tracker ___ ___

[issue2506] Add mechanism to disable optimizations

2018-10-03 Thread Yury Selivanov
Yury Selivanov added the comment: > I would suggest -X noopt and use "noopt" in .pyc filenames. That's what I > proposed in my PEP 511. Sounds good to me. -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2018-10-03 Thread Yury Selivanov
Yury Selivanov added the comment: Having properly working coverage tooling is simply invaluable to pretty much every serious Python user. I support Ned's idea of adding an option to disable peephole optimizer (and similar other optimization passes). Why is this even debated? --

[issue2506] Add mechanism to disable optimizations

2018-08-28 Thread Arthur Goldberg
Arthur Goldberg added the comment: I'm another user of Ned's coverage tool. Our team at the Mount Sinai School of Medicine is building tools to model the dynamics of biochemistry inside individual cells. Our short term aims are to better understanding microbiology and model microorganisms

[issue2506] Add mechanism to disable optimizations

2018-06-02 Thread Ned Batchelder
Ned Batchelder added the comment: Serhiy: thanks for the fuller story about the optimizations in place now. I'll repeat my earlier plea: providing a way to disable optimization is beneficial for tooling like coverage.py, and also for helping us to ensure that the optimizer is working

[issue2506] Add mechanism to disable optimizations

2018-05-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Few different optimizations work together here. Folding constants at the AST level allows to eliminate the constant expression statement in the code generation stage. This makes 'continue' a first statement in the 'if' body.

[issue2506] Add mechanism to disable optimizations

2018-05-17 Thread Ned Batchelder
Ned Batchelder added the comment: Folding constants won't affect control flow. The important thing here is to disable optimizing away jumps to jumps. -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2018-05-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > If anyone has needed a workaround in the past 9 years and hasn't yet found > one: This no longer works in 3.7 due to folding constants at the AST level. :-) -- nosy: +serhiy.storchaka versions: +Python 3.8 -Python 3.6

[issue2506] Add mechanism to disable optimizations

2017-10-11 Thread Alex Gaynor
Alex Gaynor added the comment: If anyone has needed a workaround in the past 9 years and hasn't yet found one: https://github.com/pyca/cryptography/pull/3968/commits/3b585f803891e750d0ca5861b5a29e16b779bc16 -- nosy: +alex ___

[issue2506] Add mechanism to disable optimizations

2017-08-22 Thread diana
Changes by diana : -- nosy: +diana ___ Python tracker ___ ___ Python-bugs-list

[issue2506] Add mechanism to disable optimizations

2017-04-28 Thread Sergey B Kirpichev
Changes by Sergey B Kirpichev : -- nosy: +Sergey.Kirpichev ___ Python tracker ___ ___

[issue2506] Add mechanism to disable optimizations

2016-10-26 Thread STINNER Victor
STINNER Victor added the comment: I would suggest -X noopt and use "noopt" in .pyc filenames. That's what I proposed in my PEP 511. -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2016-10-26 Thread STINNER Victor
STINNER Victor added the comment: Since the discussion restarted, I reopen the issue and assigned it to Python 3.6. Maybe it's too late for such tiny change? -- resolution: rejected -> status: closed -> open versions: +Python 3.6 -Python 3.5 ___

[issue2506] Add mechanism to disable optimizations

2016-10-25 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing

[issue2506] Add mechanism to disable optimizations

2015-10-22 Thread Brett Cannon
Brett Cannon added the comment: I believe the python-ideas thread on this topic came to the conclusion that a -X flag -- e.g., `-X DisableOptimizations` -- would be a good way to turn off all optimizations. The flag could then either blindly set sys.dont_write_bytecode to True or set

[issue2506] Add mechanism to disable optimizations

2014-06-22 Thread Pedro Gimeno
Pedro Gimeno added the comment: I consider peephole optimization when no optimization was requested a bug. Documentation for -O says it Turns on basic optimizations. Peephole optimization is a basic optimization, yet it is performed even when no basic optimizations were requested. No need to

[issue2506] Add mechanism to disable optimizations

2014-05-22 Thread STINNER Victor
STINNER Victor added the comment: Have you considered whether the genererated PYC files need a different magic number or some other way to indicate that they aren't production code? Would it make sense to use a different sys.implementation.cache_tag? For example, the tag si currently

[issue2506] Add mechanism to disable optimizations

2014-05-22 Thread STINNER Victor
STINNER Victor added the comment: Oh, another option to solve the .pyc file issue is to *not* write .pyc files if the peephole optimizer is disabled. If you disable an optimizer, you probably don't care of performances. -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2014-05-22 Thread Ned Batchelder
Ned Batchelder added the comment: I thought we were discussing this on Python-Ideas? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___

[issue2506] Add mechanism to disable optimizations

2014-05-22 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___ Python-bugs-list

[issue2506] Add mechanism to disable optimizations

2014-05-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Victor] Oh, another option to solve the .pyc file issue is to *not* write .pyc files if the peephole optimizer is disabled. If you disable an optimizer, you probably don't care of performances. That is an inspired idea and would help address one of the

[issue2506] Add mechanism to disable optimizations

2014-05-21 Thread Ned Batchelder
Ned Batchelder added the comment: Python-Ideas thread started: https://mail.python.org/pipermail/python-ideas/2014-May/027893.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___

[issue2506] Add mechanism to disable optimizations

2014-05-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Ned, why is your proposal to turn-off ALL peephole transformations with COMMAND-LINE switch? * Why not just turn-off the jump-to-jump? Do you really need to disable constant folding and other transformations? * Have you explored whether the peephole.c

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: There has been no activity on this for several year. Marking as rejected for the reasons originally listed. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Ned Batchelder
Ned Batchelder added the comment: Raymond, thanks for keeping us honest! I am still hoping to convince people that this is a good idea. I think Guido's +1 (https://mail.python.org/pipermail/python-dev/2012-December/123099.html) should help in that regard. Part of your reason for today's

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Trip Volpe
Trip Volpe added the comment: I found this issue just the other day while researching why we were getting false gaps in our test coverage reports (using Ned's coverage module, natch!). I agree that this seems like a fairly minor nuisance, but it's a nuisance that anybody who has tests and

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___ Python-bugs-list

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Trip, see msg140290, which was ignored. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___

[issue2506] Add mechanism to disable optimizations

2014-05-16 Thread Trip Volpe
Changes by Trip Volpe t...@flowroute.com: -- nosy: +Trip.Volpe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___ Python-bugs-list mailing

[issue2506] Add mechanism to disable optimizations

2014-05-16 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone jean-p...@hybridcluster.com: -- nosy: -exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___

[issue2506] Add mechanism to disable optimizations

2013-11-18 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___ Python-bugs-list mailing

[issue2506] Add mechanism to disable optimizations

2013-08-17 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___

[issue2506] Add mechanism to disable optimizations

2011-07-15 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- title: Add mechanism to diasable optimizations - Add mechanism to disable optimizations ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___