Before I actually test it out, I want to know this.
I have a plist with 210 dictionaries, and in my code I initialize an NSArray through the contents of that plist.
Out of all these dictionaries, I need to enumerate through them and check for something:
for (NSDictionary *dict in largePlistArray) {
if ([[dict objectForKey: @"country"] isEqualToString: @"Cambodia"]) {
NSLog (@"Random example!");
}
}
Let us say the dictionary with ‘Cambodia’ is the last in the whole array, how long will it take to enumerate through an full 200+ object array of dictionaries?
Thanks!
The best way to tell is to try it out. However,
200does not strike me as a particularly large or even as a marginally large number. Consider this: 1GHz CPU runs a billion elementary operations per second. Even if each lookup takes 100 elementary operations (in reality, it takes much fewer than that) a search of200items should complete in very short time, on the order of milliseconds.