0

We have an Angular.js app with UI Router. On any modern browser, our app is pretty fast. However, on one of our target devices, the view change is just way too slow (mostly because it's executing JS horribly at the moment - that's a side-issue that we're fixing).

The main problem we're seeing is that we have a mouse event that kicks off the view change via a $location.path change, and it's running at 250ms - 400ms.

screen cap of offending mouse event

We've tried tons of things, like abandoning the Hammer events we're using to call the code, stripping down the app so that only a blank view is loaded, removing all of the XHR calls we had, removing DOM manipulation, and host of other little experiments.

The jQuery event being called is jQuery.event.add (specifically line 4305 of jQuery 1.11.1).

What we're hoping is that someone has experienced a similar problem and can help diagnose what would trigger the plethora of Remove Timer events, GC Events, Parse HTML, Request Animation Frames, Install Timers, and Recalculate Styles. Each of them appears to be in the microseconds or at most < 2 milliseconds, and the cumulative total is nowhere near the hundreds of milliseconds we're seeing.

1
  • Is there any way you can isolate some of the code into JSFiddle so that it's easier to diagnose what the issue is? If most of the issue is in jQuery.event.add I would look into anywhere where you might be adding an eventHandler to the mouseOver/mouseMove Jul 3, 2014 at 17:51

1 Answer 1

0

The issue turned out to be that the target device I mentioned was running JavaScript 40 times slower than Chrome on our dev machines, and 20 times slower than the other devices we had. We just ran SunSpder to determine the speeds.

The slowness of the JS Engines only actually exacerbated the problem. We still had to do a bunch of optimizations to clean things up: - Strip down the objects bound to ng-repeat - Put bindonce with refresh-on in place (we already had lots of bo-text in place, we just needed the ability to refresh)

Now the app has much less latency.

Estaban, sorry for not posting code, and thanks for the response. It was going to be too much work to extricate what we needed to present a clear picture.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.