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/
- [Python-ideas] R... Chris Angelico
- [Python-ideas] R... Richard Higginbotham
- [Python-ideas] Re: Set op... Andrew Barnert via Python-ideas
- [Python-ideas] Re: Set operations wit... Richard Higginbotham
- [Python-ideas] Re: Set operations... Chris Angelico
- [Python-ideas] Re: Set operat... Richard Higginbotham
- [Python-ideas] Re: Set operations... Andrew Barnert via Python-ideas
- [Python-ideas] Re: Set operations with Lis... Andrew Barnert via Python-ideas
- [Python-ideas] Re: Set operations wit... Richard Higginbotham
- [Python-ideas] Re: Set operations... Chris Angelico
- [Python-ideas] Re: Set operat... Richard Higginbotham
- [Python-ideas] Re: Set op... Andrew Barnert via Python-ideas
- [Python-ideas] Re: S... Rhodri James
- [Python-ideas] Re: S... Richard Higginbotham
- [Python-ideas] Re: Set op... Tim Peters
- [Python-ideas] Re: S... Steven D'Aprano
- [Python-ideas] R... Richard Musil
- [Python-ideas] R... Andrew Barnert via Python-ideas
- [Python-ideas] R... Tim Peters
- [Python-ideas] Re: S... Richard Higginbotham
- [Python-ideas] Re: S... Andrew Barnert via Python-ideas