Parallel local data storage query takes time on Android

This is the first time I pinned an object. The next time I try to retrieve the same object, it takes time, for example 5 to 6 seconds. The screen goes blank.

Here is my code for pinning. (Both pinning and querying data from local storage are done in the same table in parsing)

ParseQuery<ParseObject> query = ParseQuery.getQuery(PARSE_IMAGE_TABLE);
List<ParseObject> images = query.find();

for each image i get i do following:

parseObject.pinInBackground(PARSE_PIN_WALLPAPER_INFO,
                            new SaveCallback() {

                                @Override
                                public void done(ParseException arg0) {
                                    System.out.println();

                                }
                            });

      

When requested:

ParseQuery<ParseObject> query = ParseQuery.getQuery(PARSE_IMAGE_TABLE);
        query.whereEqualTo(PARSE_IMAGE_THUMB_URL, imageURL);
        query.fromLocalDatastore();
        query.fromPin();

List<ParseObject> images = query.find(); -- this call takes time

      

+3


source to share


1 answer


Yes, you have a lot of performance tweaks that you can do in your code. Object list binding is faster and better.

Use findInBackground instead of using search query.



Also start using pin (line name) and fromPin (line name) instead of fromPin () and fromPin (line name). This has a huge advantage if you have many lines in your local parsing store.

+1


source







All Articles