26.12.19 00:56, Tim Peters пише:
- I don't have a theory for why dict build time is _so_ much higher than dict lookup time for the nasty keys.
1/2 of items were copied to a new hashtable when the dict grew up. 1/4 of items were copied twice. 1/8 of items were copied three times, etc. In average every item is copied 1 time, so the build time is twice the lookup time when the cost of lookup is dominated.
But the lookup benchmarking includes the overhead of iterating Python loop, which is more significant for "good" keys, thus the lookup time is larger than the build time.
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/J5BUQZQUHONX6R6GLD5ESH5XVWLP3INS/ Code of Conduct: http://python.org/psf/codeofconduct/