-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Labels
Description
Problem
Currently, the way multiset works is that it notifies subscribers of any changes to the onyx keys in a loop:
Lines 985 to 992 in f96fa2d
| _.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:
- Update
multisetto support the above, or - Create a
setCollectionthat is optimized for collections
cc @marcaaron
marcaaron