Issue18771: Reduce the cost of hash collisions for set objects.

This commit is contained in:
Raymond Hettinger 2013-08-19 07:36:04 -07:00
parent 319f3a10f9
commit 3c0a4f5def
2 changed files with 88 additions and 22 deletions

View file

@ -51,9 +51,9 @@ struct _setobject {
*/
setentry *table;
setentry *(*lookup)(PySetObject *so, PyObject *key, Py_hash_t hash);
Py_hash_t hash; /* only used by frozenset objects */
setentry smalltable[PySet_MINSIZE];
Py_hash_t hash; /* only used by frozenset objects */
PyObject *weakreflist; /* List of weak references */
};
#endif /* Py_LIMITED_API */