Re: [Python-Dev] memcmp performance

2011-10-25 Thread Stefan Behnel
Richard Saunders, 25.10.2011 01:17: -On [20111024 09:22], Stefan Behnel wrote: I agree. Given that the analysis shows that the libc memcmp() is particularly fast on many Linux systems, it should be up to the Python package maintainers for these systems to set that option externally through

Re: [Python-Dev] memcmp performance

2011-10-25 Thread Victor Stinner
Le Mardi 25 Octobre 2011 10:44:16 Stefan Behnel a écrit : Richard Saunders, 25.10.2011 01:17: -On [20111024 09:22], Stefan Behnel wrote: I agree. Given that the analysis shows that the libc memcmp() is particularly fast on many Linux systems, it should be up to the Python package

Re: [Python-Dev] memcmp performance

2011-10-24 Thread Richard Saunders
-On [20111024 09:22], Stefan Behnel (stefan...@behnel.de) wrote:I agree. Given that the analysis shows that the libc memcmp() isparticularly fast on many Linux systems, it should be up to the Pythonpackage maintainers for these systems to set that option externally throughthe optimisation

Re: [Python-Dev] memcmp performance

2011-10-24 Thread Stefan Behnel
Martin v. Löwis, 23.10.2011 23:44: I am still rooting for -fno-builtin-memcmp in both Python 2.7 and 3.3 ... (after we put memcmp in unicode_compare) -1. We shouldn't do anything about this. Python has the tradition of not working around platform bugs, except if the work-arounds are necessary

Re: [Python-Dev] memcmp performance

2011-10-24 Thread Jeroen Ruigrok van der Werven
-On [20111024 09:22], Stefan Behnel (stefan...@behnel.de) wrote: I agree. Given that the analysis shows that the libc memcmp() is particularly fast on many Linux systems, it should be up to the Python package maintainers for these systems to set that option externally through the optimisation

Re: [Python-Dev] memcmp performance

2011-10-23 Thread Martin v. Löwis
I am still rooting for -fno-builtin-memcmp in both Python 2.7 and 3.3 ... (after we put memcmp in unicode_compare) -1. We shouldn't do anything about this. Python has the tradition of not working around platform bugs, except if the work-arounds are necessary to make something work at all - i.e.

Re: [Python-Dev] memcmp performance

2011-10-21 Thread Stefan Behnel
Antoine Pitrou, 20.10.2011 23:08: I have been doing some performance experiments with memcmp, and I was surprised that memcmp wasn't faster than it was in Python. I did a whole, long analysis and came up with some very simple results. Thanks for the analysis. Non-bugfix work now happens on

Re: [Python-Dev] memcmp performance

2011-10-21 Thread Antoine Pitrou
On Fri, 21 Oct 2011 08:24:44 +0200 Stefan Behnel stefan...@behnel.de wrote: Antoine Pitrou, 20.10.2011 23:08: I have been doing some performance experiments with memcmp, and I was surprised that memcmp wasn't faster than it was in Python. I did a whole, long analysis and came up with some

Re: [Python-Dev] memcmp performance

2011-10-21 Thread Richard Saunders
Richard Saunders I have been doing some performance experiments with memcmp, and I was surprised that memcmp wasn't faster than it was in Python. I did a whole, long analysis and came up with some very simple results.Antoine Pitrou, 20.10.2011 23:08: Thanks for the analysis. Non-bugfix work now

Re: [Python-Dev] memcmp performance

2011-10-21 Thread Stefan Behnel
Richard Saunders, 21.10.2011 20:23: As long as the two strings are the same unicode kind, you can use a memcmp to compare. In that case, I would almost argue some memcmp optimization is even more important: unicode strings are potentially 2 to 4 times larger, so the amount of time spent in

Re: [Python-Dev] memcmp performance

2011-10-21 Thread Antoine Pitrou
On Fri, 21 Oct 2011 18:23:24 + (GMT) Richard Saunders richismyn...@me.com wrote: If both loops are the same unicode kind, we can add memcmp to unicode_compare for an optimization:        Py_ssize_t len = (len1len2) ? len1: len2;     /* use memcmp if both the same kind */     if

[Python-Dev] memcmp performance

2011-10-20 Thread Richard Saunders
Hi,This is my first time on Python-dev, so I apologize for my newbie-ness.I have been doing some performance experiments with memcmp, and I wassurprised that memcmp wasn't faster than it was in Python. I did a whole,long analysis and came up with some very simple results.Before I put in a tracker

Re: [Python-Dev] memcmp performance

2011-10-20 Thread Antoine Pitrou
Hello, I have been doing some performance experiments with memcmp, and I was surprised that memcmp wasn't faster than it was in Python.  I did a whole,  long analysis and came up with some very simple results. Before I put in a tracker bug report, I wanted to present my findings and make

Re: [Python-Dev] memcmp performance

2011-10-20 Thread Scott Dial
On 10/20/2011 5:08 PM, Antoine Pitrou wrote: Have you reported gcc's outdated optimization issue to them? Or is it already solved in newer gcc versions? I checked this on gcc 4.6, and it still optimizes memcmp/strcmp into a repz cmpsb instruction on x86. This has been known to be a problem

Re: [Python-Dev] memcmp performance

2011-10-20 Thread Richard Saunders
Hey, I have been doing some performance experiments with memcmp, and I was surprised that memcmp wasn't faster than it was in Python. I did a whole, long analysis and came up with some very simple results.Paul Svensson suggested I post as much as I can as text, as people would be more likely to