[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Martin v . Löwis
Martin v. Löwis added the comment: Ok, closing the issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Note we only really see the effect if we make sure that gcc > > isn't emitting its "special" memcmp: that's why the -fno-builtin-memcmp > > is SO important on gcc builds! > > I'd rather infer the opposite: given how GCC generates code, this patch > is not w

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Richard Saunders
Richard Saunders added the comment: Some more information: Bob Arendt and I have been playing with the Fedora Core .spec file for python on Fedora Core 15: the compile options we found seem to automatically (as we did non invoke this option) invoke '-fno-builtin-memcmp' somehow? We disassembl

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Martin. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Martin v . Löwis
Martin v. Löwis added the comment: > Note we only really see the effect if we make sure that gcc > isn't emitting its "special" memcmp: that's why the -fno-builtin-memcmp > is SO important on gcc builds! I'd rather infer the opposite: given how GCC generates code, this patch is not worthwhile.

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I am currently working with Bob Arendt (a colleague who works > frequently with Fedora) to try to put the > -fno-builtin-memcmp in the .spec file for their Python Wouldn't it be better to have it enabled by default in their gcc? -- _

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Richard Saunders
Richard Saunders added the comment: Added branches for specializing for UCS2 and UCS4 types -- Added file: http://bugs.python.org/file23574/unicode_with_memcmp_and_ucs_specialization.patch ___ Python tracker

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-31 Thread Richard Saunders
Richard Saunders added the comment: Here's a test demonstrating the memcmp optimization effect: --- more ~/PickTest5/Python/string_test3.py a = [] b = [] c = [] d = [] for x in range(0,1000) : a.append("the quick brown fox"+str(x))

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-28 Thread STINNER Victor
STINNER Victor added the comment: > These 3 minor optimizations can make unicode_compare faster. Can you please try to write a short benchmark script? (or just run a benchmark using ./python -m timeit) -- ___ Python tracker

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-28 Thread STINNER Victor
STINNER Victor added the comment: I would be nice to have a third path for inegality with kind1==kind2, something like: else if (kind1 == PyUnicode_2BYTE_KIND && kind2 == PyUnicode_2BYTE_KIND) { /* use Py_UCS2* pointers */ } else if (kind1 == PyUnicode_4BYTE_KIND && kind2 == PyUnicode_4BYTE_

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-27 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- nosy: +petri.lehtinen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +ezio.melotti, haypo stage: -> patch review versions: -Python 3.4 ___ Python tracker ___ ___ Py

[issue13279] Add memcmp into unicode_compare for optimizing comparisons

2011-10-27 Thread Richard Saunders
Richard Saunders added the comment: This is a potential patch: I believe it follows the C-style of PEP 7 There is a test as well, testing 1 and 2 byte kinds. I have run it through the python tests and have added no new breakages (there were some tests that failed, but they failed with and wit