I’m using a Dictionary<> to store a bazillion items. Is it safe to assume that as long as the server’s memory has enough space to accommodate these bazillion items that I’ll get near O(1) retrieval of items from it? What should I know about using a generic Dictionary as huge cache when performance is important?
EDIT: I shouldn’t rely on the default implementations? What makes for a good hashing function?
It depends, just about entirely, on how good a hashing functionality your “bazillion items” support — if their hashing function is not excellent (so that many conflicts result) your performance will degrade with the growth of the dictionary.