Is enyo.ajax asynchronous as default?

I am having some trouble with porting an Enyo app I am working on into a phonegap container. I am running the application on an Android device but I am having severe lagging issues.

It seems to be stemming from my Ajax call.

I have a call as follows:
var ajax = new enyo.Ajax({
url: 'myURLGoesHere',
method: 'POST',
postBody: Some data here,
async: true
});
ajax.response(this, callBackFunction);
ajax.error(this, "Error");
ajax.go();
And when I run the android application I get the following warning in the console:
02-18 15:20:54.538: I/Choreographer(1746): Skipped 51 frames! The application may be doing too much work on its main thread.
If I comment out the Ajax call I don't get the lag or the error, async: true doesn't help at all. Is there something I am doing wrong here? Why is the Ajax call blocking my thread on Android?

Comments

  • There's no "async" property for enyo.Ajax. Instead, there's a sync property that defaults to false. You don't normally need to set anything to get the default async behavior.

    How much data are you loading in that call? Maybe you're just seeing a lot of processing time for the response instead of a network delay.
  • edited February 2014
    It was a lot of data but after playing around with the code a lot it looks like its not the Ajax calls now at all as with all network calls commented out I am still getting the lag and the errors in the log.

    Is there any tips available on how to debug this behaviour?
  • If you can, try running the app as a web app and use the profiling tools in Chrome to look at what code is running most frequently. It might point you to something where you need to break your processing into multiple steps, or maybe there's some inefficient path in the framework that you're hitting.
Sign In or Register to comment.