[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 : -- nosy: +meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

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

2012-10-25 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[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 date:Tue Oct 23 02:48:49 2012 +0200 files: Objects/unicodeobject.c description: Optimize PyUnicode_RichCompare() for Py_EQ and P

[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 check-hash-befor

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

2012-10-19 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 trac

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

2012-10-19 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

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

2012-10-19 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman : -- nosy: +djc ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[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 ___ ___

[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 by