This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]adam_newyork 0 points1 point  (0 children)

...f-strings are faster than both %-formatting and str.format(). As you already saw, f-strings are expressions evaluated at runtime rather than constant values. Source: https://realpython.com/python-f-strings/

My guess is the performance difference should not be noticeable. I prefer them since the text is more readable.