Le jeudi 15 septembre 2011 17:50:41, Martin v. Löwis a écrit : > In reviewing memory usage, I found potential for saving more memory for > ASCII-only strings. (...) > > typedef struct { > PyObject_HEAD > Py_ssize_t length; > union { > void *any; > Py_UCS1 *latin1; > Py_UCS2 *ucs2; > Py_UCS4 *ucs4; > } data; > Py_hash_t hash; > int state; /* may include SSTATE_SHORT_ASCII flag */ > wchar_t *wstr; > } PyASCIIObject; I like it. If we start which such optimization, we can also also remove data from strings allocated by the new API (it can be computed: object pointer + size of the structure). See my email for my proposition of structures: Re: [Python-Dev] PEP 393 review Thu Aug 25 00:29:19 2011 You may reorganize fields to be able to cast PyUnicodeObject to PyASCIIObject. Victor
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