Opened on 09/15/2016 at 07:38:40 AM

Last modified on 09/19/2016 at 07:31:10 AM

#4433 new change

Getting element hiding selectors takes too long

Reported by: asmirnov Assignee: asmirnov
Priority: P3 Milestone:
Module: Libadblockplus-Android Keywords:
Cc: sergz, fhd Blocked By: #4399, #4444
Blocking: Platform: Android
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Background

We need FilterEngine instance for AdblockWebView to perform resource loading filtering and element hiding.
Currently FilterEngine instance getElementHidingSelectors(String domain) invocation takes about 2 seconds (tested with Samsung Note 3) and it looks not good as the user can't see the page that time.

What to change

One need to understand the reason and optimize it (if possible).

One possible optimization is to request selectors list right after loading starts and at the time we need selectors list it could be ready.

Attachments (0)

Change History (4)

comment:1 Changed on 09/15/2016 at 07:39:56 AM by asmirnov

C++ code:

__android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "Getting elemhide selectors");
std::vector<std::string> selectors = engine->GetElementHidingSelectors(domain);
__android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "Got them");

log:

09-15 12:19:49.241    8022-8094/org.adblockplus.libadblockplus.webviewapp V/JNI﹕ Getting elemhide selectors
09-15 12:19:51.471    8022-8094/org.adblockplus.libadblockplus.webviewapp V/JNI﹕ Got them
Last edited on 09/15/2016 at 07:40:34 AM by asmirnov

comment:2 Changed on 09/15/2016 at 12:43:40 PM by fhd

Wladimir pointed out that this might be addressed by #235 (which landed in adblockpluscore revision 6deffadd2643). So updating the core dependency in libadblockplus might already improve things here.

comment:3 Changed on 09/16/2016 at 08:48:02 AM by trev

This isn't "might" but rather very definitive - performance of ElemHide.getSelectorsByDomain() was very bad before #235, the performance here wasn't optimized at all due to Firefox not using this code path.

comment:4 Changed on 09/19/2016 at 07:31:10 AM by sergz

  • Blocked By 4444 added

Add Comment

Modify Ticket

Change Properties
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from asmirnov.
Next status will be 'reviewing'.
 
Note: See TracTickets for help on using tickets.