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 eric.smith, poostenr, steven.daprano, ubehera, vstinner
Date 2016-01-15.08:24:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452846241.63.0.898753865665.issue26118@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2016-01-15 08:24:01vstinnersetrecipients: + vstinner, eric.smith, steven.daprano, poostenr, ubehera
2016-01-15 08:24:01vstinnersetmessageid: <1452846241.63.0.898753865665.issue26118@psf.upfronthosting.co.za>
2016-01-15 08:24:01vstinnerlinkissue26118 messages
2016-01-15 08:24:01vstinnercreate