This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients ajaksu2, amaury.forgeotdarc, collinwinter, ezio.melotti, jafo, lemburg, orivej, pitrou, vstinner
Date 2009-05-25.08:45:43
SpamBayes Score 0.000382021
Marked as misclassified No
Message-id <1243241145.99.0.0906306322763.issue1943@psf.upfronthosting.co.za>
In-reply-to
Content
Looking at the comments, it seems that the performance gain comes from
the removal of the double allocation which is needed by the current design.

Was the following implementation considered:
- keep the current PyUnicodeObject structure
- for small strings, allocate one chunk of memory:
sizeof(PyUnicodeObject)+2*length. Then set self->str=(Py_UNICODE*)(self+1);
- for large strings, self->str may be allocated separately.
- unicode_dealloc() must be careful and not free self->str if it is
contiguous to the object (it's probably a good idea to reuse the
self->state field for this purpose).
History
Date User Action Args
2009-05-25 08:45:46amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, lemburg, collinwinter, jafo, pitrou, vstinner, ajaksu2, orivej, ezio.melotti
2009-05-25 08:45:45amaury.forgeotdarcsetmessageid: <1243241145.99.0.0906306322763.issue1943@psf.upfronthosting.co.za>
2009-05-25 08:45:44amaury.forgeotdarclinkissue1943 messages
2009-05-25 08:45:43amaury.forgeotdarccreate