Message202851
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. |
|
Date |
User |
Action |
Args |
2013-11-14 15:31:41 | vstinner | set | recipients:
+ vstinner, pitrou, serhiy.storchaka |
2013-11-14 15:31:41 | vstinner | set | messageid: <1384443101.88.0.17983296976.issue19581@psf.upfronthosting.co.za> |
2013-11-14 15:31:41 | vstinner | link | issue19581 messages |
2013-11-14 15:31:41 | vstinner | create | |
|