1

I am developing a application that needs to read/write some data. So my first solution was to store the data in a json encoded string in a sqlite database. Since deserialization of the json string was slow (about 5sec) and i couldn't pre buffer any data i decided to store the data in a binary file (on the disk). For that i have implemented a reader that reads the binary file. Now i have compared the speed results and found out that the times are more or less the same (the file size is better though).

I am using NSFileHandle for reading the file and i am reading it line by line. I tested this on a iPhone 3GS with 0.5 MB of data. Is this normal? Should i switch to reading the file using C/C++ functions? Would it be any better? Does any one have any experience with this? My code is more or less based on this question How to read data from NSFileHandle line by line?.

Thanks!

Community
  • 1
  • 1
blejzz
  • 3,349
  • 4
  • 39
  • 60

0 Answers0