[issue16562] Optimize dict equality test

2012-12-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The patch looks correct. If the tests pass, go ahead and apply it. Done. -- nosy: +pitrou resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue16562] Optimize dict equality test

2012-12-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset d12785ecca72 by Antoine Pitrou in branch 'default': Issue #16562: Optimize dict equality testing. http://hg.python.org/cpython/rev/d12785ecca72 -- nosy: +python-dev ___ Python tracker

[issue16562] Optimize dict equality test

2012-11-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: The patch looks correct. If the tests pass, go ahead and apply it. -- ___ Python tracker ___ ___

[issue16562] Optimize dict equality test

2012-11-27 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16562] Optimize dict equality test

2012-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And here is a synthetic microbenchmark: $ ./python -m timeit -s "n=10**3; k=2; a={(i,)*k:i for i in range(n)}; b={(i,)*k:i for i in range(n)}" "a == b" Vanilla: 251 usec per loop Patched: 195 usec per loop $ ./python -m timeit -s "n=10**3; k=2; a={(i,)*k:i

[issue16562] Optimize dict equality test

2012-11-27 Thread Martin v . Löwis
Martin v. Löwis added the comment: The patch looks good to me. -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue16562] Optimize dict equality test

2012-11-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a simple patch. > Note, the optimized path should be used only when PyDict_CheckExact() is true. Actually this is not needed. dict_equal() uses the same code for dict subclasses. -- keywords: +patch nosy: +serhiy.storchaka stage: -> patch r

[issue16562] Optimize dict equality test

2012-11-26 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16562] Optimize dict equality test

2012-11-26 Thread Raymond Hettinger
New submission from Raymond Hettinger: The code for dict_equal() in Objects/dictobject.c currently loops over the key/value pairs in self and uses PyDict_GetItem() to check for the corresponding key/value pair in the other dictionary. This causes an unnecessary call to PyObject_Hash(). Inste