If I know what the keys are, I don't really want to load them one at a time, right? This is for situations where I have a specific sized table that I want to use for counting. (I was originally going to use a list but decided that they're not really designed for lookup like dictionaries are). I don't consider it premature optimization because I'm not really optimizing anything, just applying what I know about the problem.
But based on what you’re describing a collection makes more sense. That being said they’re all right that this is sweating the small stuff. For one, using Python and getting the count when querying the database is going to be faster than anything Java can do.
1
u/anvils-reloaded Jan 05 '18
If I know what the keys are, I don't really want to load them one at a time, right? This is for situations where I have a specific sized table that I want to use for counting. (I was originally going to use a list but decided that they're not really designed for lookup like dictionaries are). I don't consider it premature optimization because I'm not really optimizing anything, just applying what I know about the problem.