[portland] Python dictionary performance as memory usage increases

Ryan Roser ryanroser at gmail.com
Fri Aug 5 21:05:40 CEST 2011


I think you're right.  The garbage collector is causing the slowdown.  If I
disable the garbage collector for the "memory occupied" test, the run time
is very similar.

- Ryan

##### The edit:
import gc
print 'runtimes with memory occupied'

##### Performance:
$ python2.6 tester2.py
runtimes with memory empty
dict w/o lists: 0.0598680973053
dict w lists:   0.079540014267
loading data
runtimes with memory occupied
dict w/o lists: 0.0467381477356
dict w lists:   0.0416531562805

On Fri, Aug 5, 2011 at 12:11 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

> Joseph Burks wrote:
>> I don't have a system quite that beefy to test on at the moment to profile
>> more deeply.
> No kidding -- I tried the test code, and his slow case of 2.xxx took me
> 243.xxx !
> ~Ethan~
> ______________________________**_________________
> Portland mailing list
> Portland at python.org
> http://mail.python.org/**mailman/listinfo/portland<http://mail.python.org/mailman/listinfo/portland>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/portland/attachments/20110805/27579e3a/attachment.html>

More information about the Portland mailing list