[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

Serhiy Storchaka report at bugs.python.org
Wed Jul 6 03:55:54 EDT 2016


Serhiy Storchaka added the comment:

1. It would be interesting to see an example showing the benefit of this change. How large is the benefit, and how common is this case?

2. The optimization of string concatenation is CPython specific, and AFAIK it was decided not to extend it to other cases (e.g. to bytes). The recommended way for efficient string concatenation is using str.join or io.StringIO. Or classic string formatting -- this is yet one CPython specific optimization.

3. Non-compact string representation is legacy. It is kept for compatibility with existing code, but will be removed in future. The work with non-compact strings is not always efficient.

----------
nosy: +gvanrossum, serhiy.storchaka

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


More information about the Python-bugs-list mailing list