On 20 Mar 2014 07:38, "Nick Coghlan" <ncogh...@gmail.com> wrote:
>
> Correct, but I think this discussion has established that "how many times
dict lookup calls __eq__ on the key" is one such thing. In CPython, it
already varies based on:
>
> - dict contents (due to the identity check and the distribution of
entries across hash buckets)
> - pointer size (due to the hash bucket distribution differing between 32
bit and 64 bit builds)
> - dict tuning parameters (there are some settings in the dict
implementation that affect when dicts resize up and down, etc, which can
mean the hash bucket distribution may already change without much notice in
feature releases)

I just realised that hash randomisation also comes into play here - the
distribution of entries across hash buckets is inherently variable between
runs for any key types that rely directly or indirectly on a randomised
hash.

Cheers,
Nick.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to