[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-14 Thread STINNER Victor
STINNER Victor added the comment: > Because the line number is now correctly set for every bytecode instruction. That's a great enhancement! Should it be documented in https://docs.python.org/3.8/whatsnew/3.8.html ? -- ___ Python tracker

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Do you know why 255 became more common? Because the line number is now correctly set for every bytecode instruction. Compare the output in msg345108 for 3.8 with the corresponding output in 3.7: 1 0 BUILD_LIST 0 2

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Not unless someone can show how this is a major problem in 3.7 I would say is not a major problem in 3.7 I will close the issue then. Thanks everyone who participated! -- resolution: -> fixed stage: patch review -> resolved status: open

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-13 Thread Ned Deily
Ned Deily added the comment: > Should we backport this to 3.7 as well? Not unless someone can show how this is a major problem in 3.7 and then only if the changes will not introduce any 3.7.x compatibility problems. -- nosy: +ned.deily ___ Python

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Should we backport this to 3.7 as well? -- ___ Python tracker ___ ___ Python-bugs-list

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-13 Thread miss-islington
miss-islington added the comment: New changeset 5282b3b1d2e0bdf13899b1616aea20a6e3c4e13e by Miss Islington (bot) in branch '3.8': bpo-37213: Handle negative line deltas correctly in the peephole optimizer (GH-13969)

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-13 Thread STINNER Victor
STINNER Victor added the comment: > The optimization is skipped if lnotab contains 255. It was very uncommon in > older versions (only when the function contains very large expressions, > larger than hundreds of lines or bytecode instructions), but in 3.8 this > situation is common. Do you

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-13 Thread miss-islington
Change by miss-islington : -- pull_requests: +13923 pull_request: https://github.com/python/cpython/pull/14063 ___ Python tracker ___

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 3498c642f4e83f3d8e2214654c0fa8e0d51cebe5 by Pablo Galindo in branch 'master': bpo-37213: Handle negative line deltas correctly in the peephole optimizer (GH-13969)

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: test_peepholer.diff adds tests which cover various peepholer optimizations not tested before. All of them are failed now and should be passed after merging PR 13969. Pablo, you can include these tests in PR 13969. -- Added file:

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-11 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: -yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-11 Thread STINNER Victor
STINNER Victor added the comment: I removed the memchr(255) to see which tests fail: test_extended_opargs (test.test_modulefinder.ModuleFinderTest) ... python: Python/peephole.c:469: PyCode_Optimize: Assertion `cum_orig_offset % sizeof(_Py_CODEUNIT) == 0' failed. Fatal Python error: Aborted

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-11 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +13836 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13969 ___ Python tracker

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, we should backport the fix to 3.8. There is a bug in 3.8. -- ___ Python tracker ___ ___

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thank you very much, Serhiy! I am interested, I will try to look at the problem and try to get a PR soon. What of the two possible solutions that you mention you think is better? I assume if we make the peephole optimizer work with lnotab containing

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +3.8regression ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37213] Peeephole optimizer does not optimize functions with multiline expressions

2019-06-10 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The optimization is skipped if lnotab contains 255. It was very uncommon in older versions (only when the function contains very large expressions, larger than hundreds of lines or bytecode instructions), but in 3.8 this situation is common. For