Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
improve performance by not to save/load the whole data everytime #31
It seems that each time we read/write to this service, it load/save the whole big string from localstorage, which might lead to big performance problem when the string is very very long.
It could be improved by not to save all data into a single localstorage item name, but to save different items based on each record's id. Then we just need to call
BTW, we could also consider making an interface for localforage, a wrapper and extension for localstorage.
The reason is that the adapter can rely on feathers-memory for everything except for writing and reading from localStorage. Writes are throttled so if you make 100 changes at once it will only cause one write. The adapter also only reads from localStorage once during initialization. I would argue that it is in general probably faster than writing and reading individual items from localStorage every time.
If you are still concerned about write performance you can set the