On Mon, 16 Jun 2008 11:30:19 -0600, Ian Kelly <ian.g.kelly@gm ail.comwrote:
Yep. The optimization is done directly from the eval loop. Take a look at
ceval.c, if you search for _PyString_Resiz e you should see it.
Jean-Paul
>On Mon, Jun 16, 2008 at 11:09 AM, Jean-Paul Calderone
><exarkun@divmo d.comwrote:
>
>AFAICT, PyString_Concat never calls _PyString_Resiz e. Am I looking in
>the wrong place?
><exarkun@divmo d.comwrote:
>It will depend what version of Python you're using and the *exact* details
>of the code in question. An optimization was introduced where, if the
>string being concatenated to is not referred to anywhere else, it will be
>re-sized in place. This means you'll probably see sub-quadratic behavior,
>but only with a version of Python where this optimization exists and only
>if the code can manage to trigger it.
>of the code in question. An optimization was introduced where, if the
>string being concatenated to is not referred to anywhere else, it will be
>re-sized in place. This means you'll probably see sub-quadratic behavior,
>but only with a version of Python where this optimization exists and only
>if the code can manage to trigger it.
>AFAICT, PyString_Concat never calls _PyString_Resiz e. Am I looking in
>the wrong place?
ceval.c, if you search for _PyString_Resiz e you should see it.
Jean-Paul