DescriptionFor element hiding filters, the domains property is accessed only a couple of times (and only once after this patch). It doesn't make sense to cache the generated map since it is never going to be used again.
We generalize this by keeping track of whether the domains getter has been accessed at least once before and cache the value only if this is true.
This patch reduces the initial JS used heap by ~2.5 MB.
Patch Set 1 #Patch Set 2 : Add @private tag #Patch Set 3 : Add _domainsAccessCacheThreshold property #Patch Set 4 : Update JSDoc #
Total comments: 3
Patch Set 5 : Do not cache value for generic filters #
Total comments: 1
Patch Set 6 : Use boolean flag instead of counter #Patch Set 7 : Change shouldCacheDomain function to cacheDomain property #
MessagesTotal messages: 7
|