-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow performance with 100 children #136
Comments
My guess is that this is due to merging all of the children in. One way to make this way faster an avoid unnecessary merges is to pass a If you don't pass this property, epf always assumes all the data contains updates and performs a merge algorithm against it. Let me know how it goes, cheers! |
Btw, some perf tests like those would be great to have in epf itself, would much appreciate a PR if you get this resolved. |
Thanks, you are right, adding adapter.r['GET:/posts'] = posts: [{id: 1, comments: [1..100], rev: 1}],
comments: ({id: num, post: 1, rev: 1} for num in [1..100])
Though it is already quite acceptable time, I'm wondering if you know other 'secrets' to speed up it a bit more :) I can try to make a PR, but not sure what is correct way to implement performance tests. Is it ok to measure execution time in test? Or just check that data is correct as it is already done? |
Being as we don't have any perf tests yet, I'm fine with any mechanism. It could be enough to simply have the test present, but if there was some way to get the execution time inside and No other big low-hanging perf tricks that I can think of off the top of my head. In our app in extremely perf sensitive areas (e.g. rendering lists of hundreds of items) we generally just load the raw json (you can do this by passing serialize: false) and then manually merge in the data using |
Thanks for the tips, I'll keep in mind them. |
Hi.
I have a model with ~100 child models. When I load it for the first time (with sideloading children), it loads quite fast. But if I'd like to reload it from server for the second time it takes much much longer.
Am I using it wrong way? How do you use it in your applications? Or you have only relatively small number of models? Or you do not reload them if they are already loaded? But what if something changed on the server?
Another idea I had is to use
session.remove
for all posts and comments before loading them for the second time. But I got strange errors after removing and loading again. Seems likeremove
doesn't clear everything correctly. Isremove
supposed to be used in such scenarios?The text was updated successfully, but these errors were encountered: