Populating a dictionary, fast [SOLVED SOLVED]

Hrvoje Niksic hniksic at xemacs.org
Wed Nov 14 18:16:25 CET 2007


Aaron Watters <aaron.watters at gmail.com> writes:

> On Nov 12, 12:46 pm, "Michael Bacarella" <m... at gpshopper.com> wrote:
>>
>> > It takes about 20 seconds for me. It's possible it's related to
>> > int/long
>> > unification - try using Python 2.5. If you can't switch to 2.5, try
>> > using string keys instead of longs.
>>
>> Yes, this was it.  It ran *very* fast on Python v2.5.
>
> Um.  Is this the take away from this thread?  Longs as dictionary
> keys are bad?  Only for older versions of Python?

It sounds like Python 2.4 (and previous versions) had a bug when
populating large dicts on 64-bit architectures.

> Someone please summarize.

Yes, that would be good.



More information about the Python-list mailing list