Opened 2 years ago

Last modified 2 years ago

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

Change History (4)

comment:1 Changed 2 years ago 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 2 years ago by asmirnov (previous) (diff)

comment:2 Changed 2 years ago 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 2 years ago 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 2 years ago by sergz

  • Blocked By 4444 added
Note: See TracTickets for help on using tickets.