[Python-Dev] Nuking wstr [Re: How can we use 48bit pointer safely?]
INADA Naoki
songofacandy at gmail.com
Mon Apr 2 02:34:00 EDT 2018
>
> Of course, the question is whether all this matters. Is it important
> to save 8 bytes on each unicode object? Only testing would tell.
>
Last year, I tried to profile memory usage of web application in my company.
https://gist.github.com/methane/ce723adb9a4d32d32dc7525b738d3c31#investigating-overall-memory-usage
Without -OO option, str is the most memory eater and average size is
about 109bytes.
(Note: SQLAlchemy uses docstring very heavily).
With -OO option, str is the third memory eater, and average size was
about 73bytes.
So I think 8bytes for each string object is not negligible.
But, of course, it's vary according to applications and libraries.
--
INADA Naoki <songofacandy at gmail.com>
More information about the Python-Dev
mailing list