Is there any way to minimize str()/unicode() objects memory usage [Python 2.6.4] ?

Nobody nobody at nowhere.com
Sat Aug 7 10:41:56 EDT 2010


On Fri, 06 Aug 2010 18:39:27 -0700, dmtr wrote:

> Steven, thank you for answering. See my comments inline. Perhaps I
> should have formulated my question a bit differently: Are there any
> *compact* high performance containers for unicode()/str() objects in
> Python? By *compact* I don't mean compression. Just optimized for
> memory usage, rather than performance.
> 
> What I'm really looking for is a dict() that maps short unicode
> strings into tuples with integers.

Use UTF-8 encoded strings (str/bytes) as keys rather than unicode objects.




More information about the Python-list mailing list