This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients josh.r, pitrou, rhettinger, serhiy.storchaka
Date 2015-01-25.18:33:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422210797.33.0.664536418009.issue23282@psf.upfronthosting.co.za>
In-reply-to
Content
I had intentionally moved the entry->key == key test to be after the hash test.  Unlike dicts where exact key matches are norm, sets are used for deduping (cased where keys are equal but not dups).

By moving the test inside the entry->key == hash test, we reduce the number of comparisons per loop for collisions and increase the predictability of the entry->key == key branch (once the hash matches, the chance of an equality match is very high.

The one part I'm looking at changing is moving the dummy test after the identity key test.  However, the dummy test inside the hash test is perfectly predictable (it basicly never matches) and may be cost free.
History
Date User Action Args
2015-01-25 18:33:17rhettingersetrecipients: + rhettinger, pitrou, serhiy.storchaka, josh.r
2015-01-25 18:33:17rhettingersetmessageid: <1422210797.33.0.664536418009.issue23282@psf.upfronthosting.co.za>
2015-01-25 18:33:17rhettingerlinkissue23282 messages
2015-01-25 18:33:17rhettingercreate