Peter Otten wrote: > Lothar Werzinger wrote: >> Can anyone explain this oddity? Any insight is highly appreciated. > > When you are creating objects like there is no tomorrow Python's cyclic > garbage collections often takes a significant amount of time. The first > thing I'd try is therefore switching it off with > > import gc > gc.disable() > > Peter
Wow, that really MAKES a difference! Thanks a lot! $ ~/tmp/dicttest.py -t 0 Inserting into one map Inserting 1000000 keys lasted 0:00:01 (960152 1/s) len(map) 1000000 Inserting 1000000 keys lasted 0:00:01 (846416 1/s) len(map) 2000000 Inserting 1000000 keys lasted 0:00:04 (235241 1/s) len(map) 3000000 total 3000000 $ ~/tmp/dicttest.py -t 1 Inserting into three maps Inserting 1000000 keys lasted 0:00:01 (973344 1/s) len(map) 1000000 Inserting 1000000 keys lasted 0:00:00 (1011303 1/s) len(map) 1000000 Inserting 1000000 keys lasted 0:00:00 (1021796 1/s) len(map) 1000000 total 3000000 <~/beacon> Thanks! -- Lothar -- http://mail.python.org/mailman/listinfo/python-list