A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-October/069246.html below:

[Python-Dev] PATCH submitted: Speed up + for string concatenation, now as fast as "".join(x) idiom

[Python-Dev] PATCH submitted: Speed up + for string concatenation, now as fast as "".join(x) idiomskip at pobox.com skip at pobox.com
Sat Oct 7 13:53:43 CEST 2006
    Fredrik> Nicko van Someren wrote:
    >> If it speeds up pystone by 5.5% with such minimal down side I'm hard
    >> pressed to see a reason not to use it.

    Fredrik> can you tell me where exactly "pystone" does string
    Fredrik> concatenations?

I wondered about that as well.  While I'm not prepared to assert without a
doubt that pystone does no simpleminded string concatenation, a couple
minutes scanning the pystone source didn't turn up any.  If the pystone
speedup isn't an artifact, the absence of string concatention in pystone
suggests it's happening somewhere in the interpreter.

I applied the patch, ran the interpreter under gdb with a breakpoint set in
string_concat where the PyStringConcatenationObject is created, then ran
pystone.  The first hit was in

    site.py -> distutils/util.py -> string.py

All told, there were only 22 hits, none for very long strings, so that
doesn't explain the performance improvement.

BTW, on my Mac (OSX 10.4.8) max() is not defined.  I had to add a macro
definition to string_concat.

Skip

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4