[issue30416] constant folding opens compiler to quadratic time hashing

2018-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Okay, this issue is fixed in 3.6. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue30416] constant folding opens compiler to quadratic time hashing

2018-07-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- priority: deferred blocker -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30416] constant folding opens compiler to quadratic time hashing

2018-06-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: I vote for "won't fix". 2.7 has lived long enough with this issue, AFAIU. And it won't be triggered by regular code. -- ___ Python tracker

[issue30416] constant folding opens compiler to quadratic time hashing

2018-06-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Reverting issue27942 (67edf73183b8bf0127456454747f596428cc28f6) doesn't solve this issue in 2.7. The previous revision has this issue, as well as 2.7.12 and 2.7.11. Even 2.6.9 and 2.5.6 have this issue. We have either merge PR 4896 or decide that this

[issue30416] constant folding opens compiler to quadratic time hashing

2018-04-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: We should revert the breaking 2.7 changes. On Sun, Mar 25, 2018, at 13:59, Gregory P. Smith wrote: > > Change by Gregory P. Smith : > > > -- > assignee: -> benjamin.peterson > >

[issue30416] constant folding opens compiler to quadratic time hashing

2018-03-25 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> benjamin.peterson ___ Python tracker ___ ___

[issue30416] constant folding opens compiler to quadratic time hashing

2018-03-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +benjamin.peterson priority: normal -> deferred blocker versions: +Python 2.7 -Python 3.7 ___ Python tracker

[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What do you suggest to do with 2.7? Revert the changes that introduced the regression, merge the backported fix, or keep all as is? -- ___ Python tracker

[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 4896 fixes this issue in 2.7, but I'm not sure that I want to merge it. The code in 2.7 is more complex because of two integer types. -- ___ Python tracker

[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4788 ___ Python tracker ___ ___

[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b580f4f2bf49fd3b11f2a046911993560c02492a by Serhiy Storchaka in branch '3.6': [3.6] bpo-30416: Protect the optimizer during constant folding. (#4865)

[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2e3f5701858d1fc04caedefdd9a8ea43810270d2 by Serhiy Storchaka in branch 'master': bpo-30416: Protect the optimizer during constant folding. (#4860)

[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4755 ___ Python tracker ___ ___

[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4749 ___ Python tracker ___ ___

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yet another proof that performance improvements should *not* be committed to bugfix branches. Please, can someone learn a lesson? -- ___ Python tracker

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-23 Thread Mark Dickinson
Mark Dickinson added the comment: After testing on Python 2, I was surprised to discover that this issue was introduced to the 2.x series quite recently: 2.7.11 doesn't have the issue, while 2.7.13 does. The culprit appears to be this commit:

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes const folding more safe by checking arguments before doing expensive calculation that can create large object (multiplication, power and left shift). It fixes examples in this issue, issue21074, issue30293. The limit for repetition is

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-21 Thread Andrew Dalke
Andrew Dalke added the comment: A complex solution is to stop constant folding when there are more than a few levels of tuples. I suspect there aren't that many cases where there are more than 5 levels of tuples and where constant creation can't simply be assigned and used as a module

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Caching a tuple's hash value is a nice idea but it would increase the memory consumption of all tuples, which would probably hurt much more in the average case... Unless of course we find a way to cache the hash value in a separate memory area that's

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-21 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +pitrou ___ Python tracker ___ ___

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Nice example. The only fix I see is caching the hash in a tuple. This can even help in more cases, when tuples are used as dict keys. But this affect too much code, and can even break a code that mutates a tuple with refcount 1. -- nosy:

[issue30416] constant folding opens compiler to quadratic time hashing

2017-05-20 Thread Andrew Dalke
New submission from Andrew Dalke: Others have reported issues like #21074 where the peephole compiler generates and discards large strings, and #30293 where it generates multi-MB integers and stores them in the .pyc. This is a different issue. The code: def tuple20(): return