unicode memory usage

Gary Robinson grobinson at transpose.com
Wed Sep 3 10:13:07 EDT 2003


We have an application which involves storing a lot of strings in RAM. It
would be most convenient to use Unicode strings, but I am wary  of doubling
memory usage. My fear is based on the idea that unicode strings may take two
bytes per character in order to accomodate non-ascii characters.

But I don't know whether that's actually how Python strings work internally.

So, my question: Do unicode strings in Python take substantially more memory
than classic python strings or not, assuming the strings are generally 99%
ASCII characters (but not 100%)?


--Gary

-- 
Putting http://wecanstopspam.org in your email helps it pass through
overzealous spam filters.

Gary Robinson
CEO
Transpose, LLC
grobinson at transpose.com
207-942-3463
http://www.transpose.com
http://radio.weblogs.com/0101454







More information about the Python-list mailing list