Antoine Pitrou added the comment: > I'm saying attempt, because although it works correctly, some benchmarks are > actually slower. > I didn't profile it, so I don't know if it's due to the hashtable > implementation, function call overheads, etc.
It probably shows that Python dicts (which the pickle hashtable is a rip-off of, module refcounting) are more optimized than the average hash table implementation :-) But also, _Py_hashtable_hash_ptr is quite crude in that it doesn't even try to compensate for pointer alignment, so there will automatically be many collisions. Only one hash bucket every 8 or 16 will be used, at best. And the straightforward collision resolution in hashtable.c is much less efficient at mitigating collisions than a Python dict's. ---------- nosy: +tim.peters _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21556> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com