It's not really constant though. Look at all of the test results here. Richard 
Musil in the following post shows one value of A=1000,B=10000 with .034 ms and 
the next point A=10000,B=50000 If the hash were constant time and A increased 
by 10x then the time should be 0.34ms but its not. It's 0.54 ms. The next step 
up is 8.5ms instead of 0.54 ms.
If you start including the time it takes to convert lists to sets its even more 
pronounced. hash values can collide and the bigger the data set the more likely 
it is to happen. Perfect hash functions don't exist.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/DAK4CVNK4PY7D3JOD3AR2HWLPWGTHU4V/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to