[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

Antti Haapala report at bugs.python.org
Mon Jul 11 05:25:06 EDT 2016


Antti Haapala added the comment:

Ah so it seems. Somehow I thought __format__ was slotted, but that is not the case and it needs to be looked up, and what is worse, of course a tuple needs to be built as well. 

Oh well, at least it should be quite minimal to make it be faster than `f(x)` there, which necessarily has one extra bound method call and interpretation of format string as the overhead, so there's minimally at least 30 % performance boost to achieve.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27078>
_______________________________________


More information about the Python-bugs-list mailing list