Opened on 10/25/2017 at 07:16:08 AM
Closed on 11/02/2017 at 10:10:05 AM
Last modified on 12/22/2017 at 12:31:32 PM
#5929 closed change (fixed)
Skip update subscription URLs in AndroidWebRequest if not required
Reported by: | asmirnov | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Unknown | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Background
In order to save memory AndroidWebRequest (https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java) filters out not required filters from subscriptions. For example if element hiding is disabled (enableElemhide =falsein ctor https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java#L60) it leaves lines from not listed subscriptions (https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java#L155) and removes lines with elemhide rules.
If element hiding is enabled (enableElemhide =truein ctor https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java#L60), this.elemhideEnabled (https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java#L50) is set to true and we need no listed subscription URLs at all as condition https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequest.java#L155 is always true. So there will be no isListedSubscriptionUrl() invocations and we don't need subscription URLs list at all.
Thus we can skip calling androidWebRequest.updateSubscriptionURLs(engine.filterEngine); in https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java#L254 if element hiding is enabled (by default it is enabled https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockHelper.java#L159) and improve start-up time.
It's good because it happens in UI thread and UI is frozen for the user, so we can make UI more responsive with no cost at all (just skip doing what is not required).
What to change
Skip calling androidwebRequest.updateSubscriptionURLs() if element hiding is enabled.
Attachments (0)
Change History (4)
comment:1 Changed on 10/25/2017 at 08:22:08 AM by asmirnov
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:2 Changed on 11/02/2017 at 10:09:32 AM by abpbot
comment:3 Changed on 11/02/2017 at 10:10:05 AM by asmirnov
- Resolution set to fixed
- Status changed from reviewing to closed
comment:4 Changed on 12/22/2017 at 12:31:32 PM by abpbot
A commit referencing this issue has landed:
Issue 5929 - Skip update subscription URLs in AndroidWebRequest if not required
A commit referencing this issue has landed:
Issue 5929 - Skip update subscription URLs in AndroidWebRequest if not required