[issue16286] Optimize a==b and a!=b for bytes and str

2013-01-02 Thread STINNER Victor
STINNER Victor added the comment: P.S. I rather like the optimization and don't want to discourage it. I'm just curious about what the current optimizations are missing. I'm too lazy to produce more statistics or run other benchmarks. I just saw an interesting optimization oportunity. I

[issue16286] Optimize a==b and a!=b for bytes and str

2012-12-28 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286 ___ ___ Python-bugs-list

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-25 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286 ___

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-23 Thread STINNER Victor
STINNER Victor added the comment: Oh, I forgot this issue when I did the following commit: -- changeset: 79902:b68be1025c42 user:Victor Stinner victor.stin...@gmail.com date:Tue Oct 23 02:48:49 2012 +0200 files: Objects/unicodeobject.c description: Optimize

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Rather than see statistics, I'm curious about what circumstances where the optimization would kick in. Interned strings are pre-hashed but they already benefit from an identity-implies-equality check. Dicts and sets already incorporate a

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: something to include in your statistics is the lengths of the already hashed data being compared. i expect there to be a minimum length before this optimization is useful. -- nosy: +gregory.p.smith ___ Python

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-19 Thread STINNER Victor
New submission from STINNER Victor: Attached patch optimize a==b and a!=b operators for bytes and str types of Python 3.4. For str, memcmp() is now always used, instead of a loop using PyUnicode_READ() (which is slow) for kind different than 1. For bytes, compare the first but also the last

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good. I would like to see similar statistics tests for any real application. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286 ___

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-19 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman dirk...@ochtman.nl: -- nosy: +djc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286 ___ ___ Python-bugs-list mailing

[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-19 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286 ___ ___