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 serhiy.storchaka
Recipients eric.smith, mjpieters, serhiy.storchaka, ztane
Date 2016-07-10.16:08:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468166923.98.0.0562751375955.issue27078@psf.upfronthosting.co.za>
In-reply-to
Content
For comparison:

$ ./python -m timeit -s "x = 2" -- "f'X is {x}'"
1000000 loops, best of 3: 1.04 usec per loop

$ ./python -m timeit -s "x = 2; j = ''.join" -- "j(['X is ', f'{x}'])"
1000000 loops, best of 3: 0.93 usec per loop

$ ./python -m timeit -s "x = 2" -- "'X is {}'.format(x)"
1000000 loops, best of 3: 0.808 usec per loop

$ ./python -m timeit -s "x = 2; f = 'X is {}'.format" -- "f(x)"
1000000 loops, best of 3: 0.748 usec per loop

$ ./python -m timeit -s "x = 2" -- "'X is %s' % (x,)"
1000000 loops, best of 3: 0.467 usec per loop
History
Date User Action Args
2016-07-10 16:08:44serhiy.storchakasetrecipients: + serhiy.storchaka, mjpieters, eric.smith, ztane
2016-07-10 16:08:43serhiy.storchakasetmessageid: <1468166923.98.0.0562751375955.issue27078@psf.upfronthosting.co.za>
2016-07-10 16:08:43serhiy.storchakalinkissue27078 messages
2016-07-10 16:08:43serhiy.storchakacreate