Speedup relationship mapping of data


#1

I have a simple many to many relationship (users/groups). I have a situation where I’ve loaded all the users (probably around 600 records or so), and then I load the groups. Doing this the first time causes the page to hang for at least 10 seconds while the user/group objects map to each other in the background. Both models are set to async.

Is there a way to speed this mapping up, or at least defer it somehow so it doesn’t impact the responsiveness. The slow page doesn’t actually need that mapping to be consistent, but because its the first time all the groups are loaded, the mapping takes place even though I’m not explicitly needing the relationship at that stage.


#2

Hey @gevious is there any chance you could put together a jsbin or demo app of your issue? It would be helpful to profile the app and see where Ember Data is spending most of its time.


#3

Thanks for the reply.

Its a little tricky to setup, since the speed difference isn’t noticeable for small data sets. I’ll try reproduce it locally with fixtures and if that works then I’ll to the jsbin.

Could you give me some advice on how to profile ember-data? Maybe there’s something I can do on my side and post the results here for more information.


#4

It turns out one of the groups we had was linked to about 6000 users. Even though almost none of the users were in the ember store, it still took a while to go through the records. Possibly this cannot be optimized and its simply the size of the data that is the main contributing factor.


#5

Nah, we should consider this a bug. Luckily Igor is actually crashing at my place this week and we plan on doing an ember data perf session most of tomorrow. I’ll be sure to include this use case