[issue30293] Peephole binops folding can lead to memory and bytecache ballooning

2017-05-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: -rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue30293] Peephole binops folding can lead to memory and bytecache ballooning

2017-05-09 Thread Martijn Pieters
Martijn Pieters added the comment: Thanks Raymond, for the response. I agree, we can't prevent all possible misuse, and avoiding the memory issue would require overly costly checks as to what is being multiplied or added. -- ___ Python tracker

[issue30293] Peephole binops folding can lead to memory and bytecache ballooning

2017-05-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Looking back at the OP's timings in the referenced SO question, I would expect that if someone "fixed" this issue, it wouldn't be long before someone else filed a performance regression bug claiming a 63,000x slowdown in exactly the same code. I'm marking

[issue30293] Peephole binops folding can lead to memory and bytecache ballooning

2017-05-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: A few thoughts: * This is very unlikely to come up in real code. Accordingly, I've marked this a low priority -- the peepholer is over a decade old and seems to work-out fine in actual practice. * The user explicitly asked for 1 << 5 to be computed

[issue30293] Peephole binops folding can lead to memory and bytecache ballooning

2017-05-06 Thread Martijn Pieters
New submission from Martijn Pieters: The following expression produces 127MB in constants in `co_consts` due to two 63.5MB integer objects produced when folding: ((200*200 - 2) & ((1 << 5) - 1)) + ((200*200 - 2) >> 5) The optimizer already does not store optimized *sequence