I'm learning Python at the moment and was puzzled about iterating speeds when cycling through dictionaries. In one of the tutorials we had to iterate through a dictionary and extract 'key' items for a hypothetical supermarket. I asked a question regarding best practice principles to iterate through a dictionary and was told that sorting a dictionary for iteration purposes doesn't really matter until you get to handling 'big' data sets so I shouldn't worry about it at all.
I wasn't certain why the tutor said it doesn't matter as I believe that speed is key to processing large data sets. I did some reading and found a very useful post (Python: List vs Dict for look up table) regarding this.
From this, can I assume that depending on the task, sorting of the dictionary is situational? Or would you say one should always sort a dictionary for optimal processing speeds?
To put this in more context - let's use the following example: Say we are searching for the price of a bunch of cashews in a dictionary which has 10,000 entries. In this case, if the entries were placed in a random manner in the dictionary - would the speed in searching for that entry be 'faster' if it were sorted, rather than randomly placed anywhere?
Thank you very much!