Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29909555: Issue 7046 - Defer caching of domain maps (Closed)

Created:
Oct. 13, 2018, 11:15 p.m. by Manish Jethani
Modified:
Oct. 16, 2018, 9:42 p.m.
Reviewers:
hub
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Description

For 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -14 lines) Patch
M lib/elemHide.js View 2 chunks +6 lines, -6 lines 0 comments Download
M lib/filterClasses.js View 1 2 3 4 5 6 3 chunks +43 lines, -4 lines 0 comments Download
M test/filterClasses.js View 1 2 3 4 5 6 1 chunk +17 lines, -4 lines 0 comments Download

Messages

Total messages: 7
Manish Jethani
Oct. 13, 2018, 11:15 p.m. (2018-10-13 23:15:32 UTC) #1
Manish Jethani
Patch Set 1-6 As the description says, this reduces the initial memory footprint by another ...
Oct. 15, 2018, 3:37 p.m. (2018-10-15 15:37:00 UTC) #2
Manish Jethani
On 2018/10/15 15:37:00, Manish Jethani wrote: > Patch Set 1-6 > > As the description ...
Oct. 15, 2018, 8:39 p.m. (2018-10-15 20:39:03 UTC) #3
hub
LGTM
Oct. 16, 2018, 4:51 p.m. (2018-10-16 16:51:50 UTC) #4
Manish Jethani
Patch Set 7: Change shouldCacheDomain function to cacheDomain property Sorry, I reworked this a little ...
Oct. 16, 2018, 6:03 p.m. (2018-10-16 18:03:25 UTC) #5
Manish Jethani
On 2018/10/16 18:03:25, Manish Jethani wrote: > Patch Set 7: Change shouldCacheDomain function to cacheDomain ...
Oct. 16, 2018, 6:25 p.m. (2018-10-16 18:25:42 UTC) #6
hub
Oct. 16, 2018, 9:15 p.m. (2018-10-16 21:15:55 UTC) #7
LGTM

Powered by Google App Engine
This is Rietveld