Search code examples
javascripttitaniumhttprequestappceleratortitanium-alloy

Appcelerator / Titanium - Will outputting this entire JSON response harm the app performance?


I'm making a HTTP request and pulling in a JSON structure for my app data. I used code from the Alloy documentation, which includes a line that outputs the entire response text for debugging. Does this effect the overall performance of the app during run time?

var xhr = Ti.Network.createHTTPClient({
    onload: function(e) {
        Ti.API.debug(this.responseText);         
        // rest of function...
    }
});

Solution

  • Ti.API.debug() are not executed outside of development environment and it's impact on performance is irrelevant.

    However, if you want to make sure you can write function which is executed >1000 with simple operation: adding, multiplying random values and compare execution time.