Memory and speed issues relating to reading large files in iphone
I want to read a file that contains atleast 60k words. Now I want to search if the word that is stored in a variable exist in this file or not.
Ignore the coding, I want to know the memory issues related to this problem. If I store all these words in the array and then compare them. The speed issue that will effect the iphone. If anyone has better way to do it without using memory and cpu. Kindly give me details.
If all you have is a list of words, the fastest you will probably get is to sort the file, then mmap it. You can do a binary search on the mapped memory which would be pretty quick.
The nice thing is that you can mmap it read-only, and it will not result in any dirty memory pages, which is really what you have to worry about when talking about memory usage on an iOS device.