Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-24 Thread Guido van Rossum
On 4/23/06, Martin v. Löwis [EMAIL PROTECTED] wrote: Kirat Singh wrote: The reason I looked into this to begin with was that my code used up a bunch of memory which was traceable to lots of little objects with instance dicts, so it seemed that if instancedicts took less memory I wouldn't

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-24 Thread Kirat Singh
very true, but python makes it oh so easy to be lazy :-)On 4/24/06, Guido van Rossum [EMAIL PROTECTED] wrote: On 4/23/06, Martin v. Löwis [EMAIL PROTECTED] wrote: Kirat Singh wrote: The reason I looked into this to begin with was that my code used up a bunch of memory which was traceable to

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-23 Thread Martin v. Löwis
Kirat Singh wrote: Hi, this is my first python dev post, so please forgive me if this topic has already been discussed. To my knowledge, this hasn't been discussed before. It seemed to me that removing me_hash from a dict entry would save 2/3 of the space used by dictionaries and also

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-23 Thread Tim Peters
[Kirat Singh] Hi, this is my first python dev post, so please forgive me if this topic has already been discussed. It's hard to find one that hasn't -- but it's even harder to find the old discussions ;-) It seemed to me that removing me_hash from a dict entry would save 2/3 of the space

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-23 Thread Kirat Singh
Interesting, thanks for the responses. And yeah I meant 1/3, I always mix up negatives.Agree that as you point out the biggest slowdown will be on classes that define their own __hash__, however since classes use instancedicts and this would reduce the dict size from 96 - 64 bytes, we could blow 4

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-23 Thread Martin v. Löwis
Kirat Singh wrote: The reason I looked into this to begin with was that my code used up a bunch of memory which was traceable to lots of little objects with instance dicts, so it seemed that if instancedicts took less memory I wouldn't have to go and add __slots__ to a bunch of my classes, or

[Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-22 Thread Kirat Singh
Hi, this is my first python dev post, so please forgive me if this topic has already been discussed.It seemed to me that removing me_hash from a dict entry would save 2/3 of the space used by dictionaries and also improve alignment of the entries since they'd be 8 bytes instead of 12. And sets end