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

dmtr dchichkov at gmail.com
Fri Aug 6 21:56:55 EDT 2010


> > Well...  63 bytes per item for very short unicode strings... Is there
> > any way to do better than that? Perhaps some compact unicode objects?
>
> There is a certain price you pay for having full-feature Python objects.

Are there any *compact* Python objects? Optimized for compactness?

> What are you trying to accomplish anyway? Maybe the array module can be
> of some help. Or numpy?

Ultimately a dict that can store ~20,000,000 entries: (u'short
string' : (int, int, int, int, int, int, int)).

-- Regards, Dmitry



More information about the Python-list mailing list