A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2010-March/720652.html below:

memory usage, temporary and otherwise

memory usage, temporary and otherwise memory usage, temporary and otherwiseDuncan Booth duncan.booth at invalid.invalid
Thu Mar 4 07:24:52 EST 2010
mk <mrkafk at gmail.com> wrote:

> Hm, apparently Python didn't spot that 'spam'*10 in a's values is really 
> the same string, right?

If you want it to spot that then give it a hint that it should be looking 
for identical strings:

 >>> a={}
 >>> for i in range(10000000):
...     a[i]=intern('spam'*10)

should reduce your memory use somewhat.

-- 
Duncan Booth http://kupuguy.blogspot.com

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4