Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Titanium Alloy BackboneJS I/O Speed Where is the bottleneck?

$
0
0

Hello Everyone!

I am currently using Alloy to build an App using the Model-Tableview binding. The App currently shows a list of categories, then when you click on a category it does a lookup using SQL (custom collections.fetch) where I join between the category-id and the ID of the main data table. I have everything indexed. And it is still running slow.

Currently, when I do a full fetch() of the data, It takes 52ms to pull 146 objects. Using my custom SQL query it takes 22ms to fetch 58 items. Doing some math shows that this is linear time O(n) so there is no difference in speed between the default fetch() and the custom one. These times are all using the Simulator, it takes roughly 10 times as long on the iPhone 4S(Still linear though)

My question is this: Everytime we do a collections.fetch, are we pulling from either my hard disk or flash memory? I don't feel it should take my desktop less than 5ms to pull 150 items.

Where is the bottleneck? Is it the overhead of Backbone.js? Is it the disk I/O? Should I do one massive fetch at site load, then write javascript to search through a hash already stored in memory(This would break the neat Tableview-Model binding that Tony wrote)

I am trying to figure out what I need to do. If I need to do a collection.fetch at app load once, then use Javascript to look through it I am fine with that. If using Titanium.Database is faster, I don't mind using that either but that sort of defeats the purpose of MVC. Currently, for me to load 50 items into the table view it takes about a second on the iPhone. I feel that it should be a bit faster than this.

Thank you so much for your help!

Sincerely,

John J. Donna II


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>