Skip to content
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

Update the multiSet to update subscribers in a more optimized way #313

Open
yuwenmemon opened this issue Aug 23, 2023 · 0 comments
Open
Labels

Comments

@yuwenmemon
Copy link
Contributor

Problem

Currently, the way multiset works is that it notifies subscribers of any changes to the onyx keys in a loop:

_.each(data, (val, key) => {
// Update cache and optimistically inform subscribers on the next tick
cache.set(key, val);
notifySubscribersOnNextTick(key, val);
});
return Storage.multiSet(keyValuePairs)
.catch(error => evictStorageAndRetry(error, multiSet, data));

The performance of this can be improved in relation to collections, where we can see if all the keys are part of a collection, and if so - use keysChanged to update subscribers in a more optimized way.

Solution

Either:

  1. Update multiset to support the above, or
  2. Create a setCollection that is optimized for collections

cc @marcaaron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant