ember.js
ember.js copied to clipboard
Optimize the cache
Our application has a large data set. One use-case includes destroying a large amount of data.
Analysing this scenario, I noticed that 20 seconds was spent in Cache.get: 10 seconds in store.get and 10 seconds in store.has.
By assuming that the return value never will be undefined (I verified this in the code), then the store.has is not needed.
If it is required that the return value of the function should also include undefined. Then this algorithm could be modified to optimise the hits over the misses. By changing the test value !== undefined too value !== undefined || this.store.has(key)
Is this still relevant?