0

The code in this gist: https://gist.github.com/tpitale/5537466, a part of Ember.tryFinally is causing a pause in the execution of my application. Specifically on line 9 of the gist.

I can watch the pause happen in the debugger, but I can't seem to figure out what it is that's causing the issue.

The function Ember.tryFinally is passed through many times during the normal operation, so I'm thinking it is something I'm doing in my own code, but it could be anywhere.

The pause always occurs at the same place, from clicking a simple element in a list that isn't very big.

I can make a video of the pause if that is helpful.

No network activity occurs during this pause, and it's only the first click to an element in the list. Very strange indeed!

Tony Pitale
  • 1,192
  • 2
  • 11
  • 23
  • Ultimately, it seems that `this.flush()` is called when the current fun loop is ended. This seems to be the part that is very slow. I will continue to investigate deeper and deeper. – Tony Pitale May 08 '13 at 01:25
  • Can you make a JSBin or jsFiddle highlighting this problem? What do mean it 'pauses'? As in, the debugger pauses because there is an error, or? – Alexander Wallace Matchneer May 08 '13 at 03:04
  • Unfortunately, I can't create a fiddle because the issue is of unknown origin, possible data related. Digging into what flush() does, still. – Tony Pitale May 08 '13 at 21:08
  • You should check this out: http://stackoverflow.com/questions/13597869/what-is-ember-runloop-and-how-does-it-work/14296339#14296339 – Alexander Wallace Matchneer May 08 '13 at 21:58

1 Answers1

0

The problem was the use of a filtered set that was looping over ~2000 objects to build the association. This was a problem in my code, but very hard to debug. The use of proper associations in ember-data is now working in my case with the addition of explicit inverses.

There are two solutions in this case; revert code changes when you see the problem, or else really learn to use the debugging tools in your browser.

Tony Pitale
  • 1,192
  • 2
  • 11
  • 23