Help debugging performance


#1

We are currently in the middle of a fairly big rewrite of our entire application. We are running Ember 1.13.3 and Ember-data 1.13.4 at the moment.

We have an initial data load of 110kb. A fairly sizable request, but not something that should be able the throw off Ember. Its 64 results including associations:

Example:

{
  accounts: [],
  profiles: [],
  posts: [],
  comments: []
}

Sofar so good. The request is handled, and data is shown. Now here is the problem. Its slow!

I did some profilling using Chrome dev tools to see if I could figure out what was going on. Now, I’m not as good at profilling as I would like to be so this is why I’m writing here. I would love some help figureing out what is going on.

Type         XHR Ready State Change
Total Time   10.96 s
Self Time    0.039 ms
Details      local-api:8081/api/v4/accounts

So aparently something is goign on for 11 seconds following the request from the backend. I figured that it would be some kind of post-processing of the data. It seems like Ember is fiddling with some timer operations that I can’t seem to get further down into.

Remove Timer(vendor.js:15236)

Type        Remove Timer
Total Time  0
Self Time   0
Timer ID    73
Stack trace
    Backburner._cancelItem	@ vendor.js:15236
    Backburner.cancel	        @ vendor.js:15215
    run.cancel	                @ vendor.js:34596
    Ember.deprecate	        @ (program):1062
    (anonymous function)	@ vendor.js:20134
    ember$data$lib$adapters$rest$adapter$$parseResponseHeaders	@ vendor.js:76749
    hash.success	        @ vendor.js:76642
    fire	                @ vendor.js:3350
    self.fireWith	        @ vendor.js:3462
    done	                @ vendor.js:9516
    callback	                @ vendor.js:9920

Install Timer(vendor.js:15140)

Type         Install Timer
Total Time   0
Self Time    0
Timer ID     74
Timeout      100 ms
Repeats      false
Stack trace
    Backburner.debounce	        @ vendor.js:15140
    run.debounce	        @ vendor.js:34669
    Ember.deprecate	        @ (program):1066
    (anonymous function)	@ vendor.js:20134
    ember$data$lib$adapters$rest$adapter$$parseResponseHeaders	@ vendor.js:76749
    hash.success	        @ vendor.js:76642
    fire	                @ vendor.js:3350
    self.fireWith	        @ vendor.js:3462
    done	                @ vendor.js:9516
    callback	                @ vendor.js:9920

These two, Remove Timer and Install Timer, even though they are only about 100ms combined, they just go on for almost 11 seconds.

Anyone who got any idea’s as to why this happens?


#2

Little update. After some further researching the events seem to be related to deprecation mesages which seem to have a timer on them on 100ms for some reason (maybe because of console spam?)


#3

Ok. Problem located. Ember-data is to blame.

They have fixed it in https://github.com/emberjs/data/commit/23a5b13a9bccd3f26515f4992dd59960d6649df0

I implemented most of the changes manually for now and it seems to have solved the problem.