Populating a dictionary, fast [SOLVED SOLVED]

Chris Mellon arkanes at gmail.com
Thu Nov 15 16:16:36 EST 2007


On Nov 15, 2007 2:57 PM, Steven D'Aprano
<steve at remove-this-cybersource.com.au> wrote:
> On Thu, 15 Nov 2007 10:51:08 -0600, Chris Mellon wrote:
>
> > I can't duplicate this in a dual CPU (64 bit, but running in 32 bit mode
> > with a 32 bit OS) system.
>
> Can you try it running in 64-bit mode?
>
> What Python version are you running?
>

C:\>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

I can't switch to 64 bit right now. This is a dual Core 2 Duo machine
(2 CPUs, 2 cores each).

I've looked at the deallocation code for dict objects and I can't see
anything that should be affected by 64 bitness, at least not nearly
the degree described - it DECREFs all the keys and values in the dict,
calls PyMem_Free on its memory pool (if it was large enough to be
malloced, which this certainly was, and either adds itself back to the
dict object pool or deallocs itself (if its a subclass of dict).



More information about the Python-list mailing list