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 vstinner
Recipients pitrou, serhiy.storchaka, vstinner
Date 2013-11-14.15:31:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384443101.88.0.17983296976.issue19581@psf.upfronthosting.co.za>
In-reply-to
Content
I chose 25% on Linux after some micro-benchmarks on str%args and str.format(args). If the buffer is too large, the final resize (because PyUnicodeObject must have the exact size) is slow. I suppose that realloc() can avoid copying data if the new is is very close, but has to allocate a new memory block and copy data if the new size is higher than a threshold. It's how _PyObject_Realloc() for example.
History
Date User Action Args
2013-11-14 15:31:41vstinnersetrecipients: + vstinner, pitrou, serhiy.storchaka
2013-11-14 15:31:41vstinnersetmessageid: <1384443101.88.0.17983296976.issue19581@psf.upfronthosting.co.za>
2013-11-14 15:31:41vstinnerlinkissue19581 messages
2013-11-14 15:31:41vstinnercreate