[pypy-issue] [issue926] string concatenation using + kills PyPy

Armin Rigo tracker at bugs.pypy.org
Fri Nov 18 17:42:38 CET 2011


Armin Rigo <armin.rigo at gmail.com> added the comment:

hruske: I think I have fixed the segfault (5269f0ee1ed2).  Can you try again?

The main point is that we have to decide if we would like strbuf to be enabled
by default.  It makes some sense, because it helps in similar cases than the
ones in CPython, giving "unexpectedly" linear complexity.  The differences are:

- there are cases where it works even though CPython would give up, notably if
the string is stored on some instance and we do "instance.string += ..."

- conversely, there are cases were we give up but CPython would not.  Most
importantly, it is the case if we try to do almost anything else with the string
every iteration of the loop.  For example, the loop that contains "s += ..." may
also contain "if s.endswith(..):".

----------
nosy: +arigo

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue926>
________________________________________


More information about the pypy-issue mailing list