I have a chrome packaged app i have made using Polymer paper-elements. it uses HTML5 audio tag to stream music from a online service. My issue is when the app grabs results from server and parses the array while playing. Sometimes the music will stop for a few milliseconds. (a few seconds on lowend chromebooks) I have tried to use Polymers async method to delay the work til next available microtask. This helps but causes some undesirable things to happen in interface. (content that shouldn't be displayed is shown until the async method is executed)
currently i have nothing happening in the background.js file. Everything is happening in the main.js file or within a custom element.
would i see any performance gain from using message passing to push some of the work when parsing the response to the background.js file?
example of the work that appears to cause the pause in audio.
var i = 0;
Array.prototype.forEach.call(response.albumList2.album, function (e) {
// buildObject returns the needed data from the object that is returned from the loop as well as other needed data
var obj = this.buildObject(e);
// this.wall is the array that i pass to core-list to display
this.wall.push(obj);
// this is to keep callback from executing before the array is built
i = i + 1;
if (i === response.albumList2.album.length) {
this.async(callback);
}
}.bind(this));
in this situation the callback just hides the loading spinner.
thanks in advance for any help.