Re: [Python-Dev] Idea: more compact, interned string key only dict for namespace.

2016-06-24 Thread INADA Naoki
Hi, all. I implemented my new idea. (still wip) https://github.com/methane/cpython/pull/3/files Memory usage when building Python doc with sphinx are: 1) master (shared key) 176MB 2) compact (w/ shared key) 158MB 3) compact (w/o shared key) 166MB 4) compact & interned (new) 160MB Memory usag

Re: [Python-Dev] Idea: more compact, interned string key only dict for namespace.

2016-06-23 Thread INADA Naoki
I've checked time and maxrss of sphinx-build. In case of sphinx, ## master $ rm -rf build/ $ /usr/bin/time ~/local/python-master/bin/sphinx-build -b html -d build/doctrees -D latex_paper_size= . build/html -QN 71.76user 0.27system 1:12.06elapsed 99%CPU (0avgtext+0avgdata 176248maxresident)k 8

Re: [Python-Dev] Idea: more compact, interned string key only dict for namespace.

2016-06-22 Thread INADA Naoki
Hi, Mark. Thank you for reply. On Thu, Jun 23, 2016 at 10:30 AM, Mark Shannon wrote: > Hi all, > > I think we need some more data before going any further reimplementing > dicts. > > What I would like to know is, across a set of Python programs (ideally a > representative set), what the proporti

Re: [Python-Dev] Idea: more compact, interned string key only dict for namespace.

2016-06-22 Thread INADA Naoki
> Memory usage > > > on amd64 arch. > > key-sharing dict: > > * 96 bytes for ~3 items > * 128 bytes for 4~5 items. Note: There are another shared key. * 128 bytes for ~3 items * 224 bytes for 4~5 items So, let S = how many instances shares the key, * 90 + (96 / S) bytes for

Re: [Python-Dev] Idea: more compact, interned string key only dict for namespace.

2016-06-22 Thread Mark Shannon
Hi all, I think we need some more data before going any further reimplementing dicts. What I would like to know is, across a set of Python programs (ideally a representative set), what the proportion of dicts in memory at any one time are: a) instance dicts b) other namespace dicts (classe

[Python-Dev] Idea: more compact, interned string key only dict for namespace.

2016-06-22 Thread INADA Naoki
As my last email, compact ordered dict can't preserve insertion order of key sharing dict (PEP 412). I'm thinking about deprecating key shared dict for now. Instead, my new idea is introducing more compact dict specialized for namespace. If BDFL (or BDFL delegate) likes this idea, I'll take anot