dict is really slow for big truck

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Apr 29 03:55:42 CEST 2009


On Tue, 28 Apr 2009 10:25:05 -0700, Aahz wrote:

>>but, the dict is really slow as i load more data into the memory, by the
>>way the mac i use have 16G memory. is this cased by the low performace
>>for dict to extend memory or something other reason.
> 
> Try gc.disable() before the loop and gc.enable() afterward.



And if that doesn't help, it's possible that you have run into a variant 
of this obscure, hardware-specific bug:

http://groups.google.com/group/comp.lang.python/browse_thread/
thread/77e5d747c4a727cb/


Warning: it's a LONG discussion, and threading is badly broken in it. 
There was no consensus as to whether it was a real bug or not, although 
I'm convinced it was. If you care, please spend some time reading the 
various posts with subject lines:

"Populating a dictionary, fast"
"Populating a dictionary, fast [SOLVED]"
"Populating a dictionary, fast [SOLVED SOLVED]"

here:

http://mail.python.org/pipermail/python-list/2007-November/thread.html


-- 
Steven



More information about the Python-list mailing list