Message270308
| Author |
Demur Rumed |
| Recipients |
Demur Rumed, eric.smith, mjpieters, serhiy.storchaka, ztane |
| Date |
2016年07月13日.13:14:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1468415684.65.0.295142600652.issue27078@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
fstrtup2.patch is a bit more of an involved optimization for when we are joining 2 strings. Instead it emits BINARY_ADD. This may be considered too 'niche' since it only triggers when the substitution occurs at the start or end of a string & there is only one substitution
However, it reduces the "X is {x}" testcase on my machine to 4.9 usec
Interesting thing, to consider ceiling of what we can do,
Prefixing ./python -m timeit -s "x=1"
'%s'%x 1.08 usec
'%s'%(x,) 2.04 usec
str(x) 2.9 usec
f'{x}' 3.65 usec
So we should not be aiming to compete with %. It may be worthy to convert the code to generate "x is {}".format calls tho |
|