[Python-Dev] optimization required: .format() is much slower than % (original) (raw)

Christian Heimes lists at cheimes.de
Tue May 27 20:05:19 CEST 2008


Antoine Pitrou schrieb:

In order to avoid memory consumption issues there could be a centralized cache as for regular expressions. It makes it easier to handle eviction based on various parameters, and it saves a few bytes for string objects which are never used as a formatting template.

Good idea! I suggest you hook into the string interning code and use a similar approach.

Christian



More information about the Python-Dev mailing list