I have been wondering what is the actual benefit of using Lists. Please note that my question is not "when to use what" but rather Is there any impact on performance if i insist on having maps as my primary objects
obviously if my aim is to just work on values
UPDATE after not being clear with my intent at first glance: I meant if i just want to filter a list of [8000] people whose age is > 30 , i would use a list... But can i use a map instead and have it be used instead - My Question is - will there be any performance hindrance ?
I would also use List. But do we get any performance boost - if yes - How can I see it myself.
for example if i take
List <Integer> listOfInt = new ArrayList<>(map.values());
It would make sense to use Map as my global object and serve lists based on it.
I know the key/value O(1) runtime for insert or remove in Maps but then why Lists are preferred most places i have seen.