[issue34100] Same constants in tuples are not merged while compile()

2018-11-28 Thread STINNER Victor
STINNER Victor added the comment: Thanks INADA Naoki! Thanks a simple and cool optimization! Maybe you might want to document it at https://docs.python.org/dev/whatsnew/3.8.html#optimizations ? -- ___ Python tracker

[issue34100] Same constants in tuples are not merged while compile()

2018-11-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset f7e4d3642fbb88f4e6243c952a0e223fb5df1c65 by Victor Stinner (INADA Naoki) in branch 'master': bpo-34100: compile: Re-enable frozenset merging (GH-10760) https://github.com/python/cpython/commit/f7e4d3642fbb88f4e6243c952a0e223fb5df1c65 -

[issue34100] Same constants in tuples are not merged while compile()

2018-11-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +10011 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue34100] Same constants in tuples are not merged while compile()

2018-11-28 Thread INADA Naoki
Change by INADA Naoki : -- pull_requests: +10008 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue34100] Same constants in tuples are not merged while compile()

2018-11-28 Thread STINNER Victor
STINNER Victor added the comment: Well, it's up to you. I will review your PR ;-) -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue34100] Same constants in tuples are not merged while compile()

2018-11-27 Thread INADA Naoki
INADA Naoki added the comment: I agree that modifying tuple is bad idea in general case. But in case of constants, in-place modify is the easiest approach. Our purpose is "merging" constant. On the other hand, "build new tuple and replace old tuple" approach makes two same constant tuples. I

[issue34100] Same constants in tuples are not merged while compile()

2018-11-27 Thread STINNER Victor
STINNER Victor added the comment: merge_consts_recursive(): rather than modifying the 'key' tuple, would it make sense to *add* the new key to the cache? -- ___ Python tracker __

[issue34100] Same constants in tuples are not merged while compile()

2018-11-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 1005c84535191a72ebb7587d8c5636a065b7ed79 by Victor Stinner in branch 'master': bpo-34100: Partially revert merge_consts_recursive() (GH-10743) https://github.com/python/cpython/commit/1005c84535191a72ebb7587d8c5636a065b7ed79 -- __

[issue34100] Same constants in tuples are not merged while compile()

2018-11-27 Thread STINNER Victor
STINNER Victor added the comment: > New changeset c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 by Miss Islington > (bot) (INADA Naoki) in branch 'master' This change introduced a lot of memory leaks (reference leaks): https://buildbot.python.org/all/#/builders/1/builds/422 The following change f

[issue34100] Same constants in tuples are not merged while compile()

2018-11-27 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +9990 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue34100] Same constants in tuples are not merged while compile()

2018-11-26 Thread INADA Naoki
Change by INADA Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue34100] Same constants in tuples are not merged while compile()

2018-11-26 Thread miss-islington
miss-islington added the comment: New changeset c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 by Miss Islington (bot) (INADA Naoki) in branch 'master': bpo-34100: Merge constants recursively (GH-8341) https://github.com/python/cpython/commit/c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 -- no

[issue34100] Same constants in tuples are not merged while compile()

2018-07-20 Thread INADA Naoki
INADA Naoki added the comment: This is another memory overhead comparison. It seems merging constants reduces 2~3% memory usage. import sys, django, flask sys._debugmallocstats() ### master branch class size num pools blocks in use avail blocks - - -

[issue34100] Same constants in tuples are not merged while compile()

2018-07-19 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +needs review -3.7regression stage: needs patch -> patch review type: enhancement -> resource usage ___ Python tracker ___

[issue34100] Same constants in tuples are not merged while compile()

2018-07-19 Thread INADA Naoki
INADA Naoki added the comment: Counting object types in logging/__pycache__/__init__.cpython-38.pyc: master: [('r', 1815), (')', 467), ('Z', 339), ('s', 314), ('z', 273), ('c', 157), ('N', 154), ('a', 24), ('F', 14), ('i', 11), ('T', 8)] GH-8341: [('r', 1737), (')', 375), ('Z', 339), ('s', 3

[issue34100] Same constants in tuples are not merged while compile()

2018-07-19 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +patch pull_requests: +7875 stage: needs patch -> patch review ___ Python tracker ___ ___ Pytho

[issue34100] Same constants in tuples are not merged while compile()

2018-07-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think (space) 'performance' would be a better label, as this is strictly an implementation improvement, not a language change. But we often (usually? sometimes?) limit performance improvements to the 'next version' so we have the alpha/beta/candidate rele

[issue34100] Same constants in tuples are not merged while compile()

2018-07-12 Thread Brett Cannon
Brett Cannon added the comment: I also agree that there's no bug here, so I'm marking this an enhancement and removing the regression label. -- nosy: +brett.cannon type: resource usage -> enhancement ___ Python tracker

[issue34100] Same constants in tuples are not merged while compile()

2018-07-12 Thread INADA Naoki
Change by INADA Naoki : -- title: Same integers in a tuple of constant literals are not merged -> Same constants in tuples are not merged while compile() ___ Python tracker __