New submission from Raymond Hettinger:

This code is only run when the kinds, lengths, and hashes match.  So, the 
probability of the strings being equal is VERY high.  Accordingly, there is no 
benefit to an earlier out test to see if the first characters differ.

There is a modest benefit to comparing one-character strings, but that comes at 
the expense of of testing all other string lengths.

This code is on the critical path for dicts and sets, so we don't want to slow 
it down with false optimizations or optimizations of special cases that come at 
the expense of the common, general case.

----------
keywords: +patch
Added file: http://bugs.python.org/file31258/eq_optimization.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18719>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to