Message258277
> If you see a factor of 30x difference in your code, I suspect it's not related to str.format(), but some other processing in your code.
The performance of instructions like ("x=%s" % x) or ("x={}".format(x)) depend on the length of the string. Maybe poostenr has some very long strings?
--
Closed issues related to _PyUnicodeWriter API:
* issue #14716: Use unicode_writer API for str.format()
* issue #14687: Optimize str%tuple for the PEP 393
* issue #14744: Use _PyUnicodeWriter API in str.format() internals
* issue #16147: Rewrite PyUnicode_FromFormatV() to use the _PyUnicodeWriter API
* issue #17694: Enhance _PyUnicodeWriter API to control minimum buffer length without overallocation
* issue #19513: Use PyUnicodeWriter instead of PyAccu in repr(tuple) and repr(list)
* issue #19646: Use PyUnicodeWriter in repr(dict)
I'm listing these issues because they contain microbenchmarks script if you would like to play with them. |
|
Date |
User |
Action |
Args |
2016-01-15 08:24:01 | vstinner | set | recipients:
+ vstinner, eric.smith, steven.daprano, poostenr, ubehera |
2016-01-15 08:24:01 | vstinner | set | messageid: <1452846241.63.0.898753865665.issue26118@psf.upfronthosting.co.za> |
2016-01-15 08:24:01 | vstinner | link | issue26118 messages |
2016-01-15 08:24:01 | vstinner | create | |
|