Tuesday, January 12, 2016

Approaching the deadline

Only small progress was made since my last post. A major factor was moving, which only took about a week but killed a lot of momentum. Fortunately I am settled in and back on track.

I had mentioned pre populating the Core Data storage in my app to avoid loading it on the client side, which was causing minutes long initial startup times. After much Googling I discovered such a technique was not supported. It seemed the only way to accomplish this was to write a separate app, load to the Core Data storage there, then copy over that data blob into my real app. Generally I prefer not to do things in a hack-y way, especially since future iOS, Xcode, or Swift updates could break something.

After struggling to find another solution, a random Stack Overflow comment recommended simply using a SQLite database. There was no good reason for me to use Core Data; I only went that route because I thought it was the normal storage method for iOS apps. I don't think that's the case, Core Data seems more about user specific storage (settings, etc). Once I settled on the database route it was smooth sailing.

Some of the implementation details had to change. The main difference is I'm no longer loading all the data. Instead I quickly load only the locations' latitude and longitude upfront. When determining the annotations' colors (allowed or not), two database queries give me exactly what I need.

With this change my app loads very quickly after install, and I've noticed no slowdowns when the annotations update every minute.

The issue of performance from too many annotations still exists however. I'm still only displaying 1000 points, and performance is already not great. I'm perpetually frustrated by this. How is it that Safari on my iPhone can use the web (javascript) version of my app and it works fairly well, yet this native app that is showing much fewer points runs so poorly? Makes me question my decision to go with Apple Maps over Google Maps.

No comments:

Post a Comment