Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Parsing the string of ids for a collection each time a model updates blocks the main process #143
I have a fairly big database with a table containing near 9K rows. When I fetch the collection the request takes about 8 seconds but the localsync methods takes a lot more and blocks the application.
After some debugging I found that the problem is that for each model it does the following:
This is inefficient. I think the Collection should keep track of what models were stored in an array, and after all the models are stored it should write the string with all the models ids.
And the fetch method that triggers this behaviour should return a promise that resolves when all the models are stored.
I welcome patches that improve the efficiency! If you're up to it, feel free to ask me any questions you have along the way.
Be aware of the