Opened on 09/05/2018 at 04:50:16 AM
Closed on 09/05/2018 at 06:51:42 AM
#6929 closed defect (invalid)
Performance of updating subscriptions gets worse with each update
Reported by: | mjethani | Assignee: | |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Core | Keywords: | |
Cc: | hfiguiere, jsonesen | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mjethani)
Environment
Adblock Plus core both before and after changes for #6916
Background
While testing the performance for the changes for #6916, I noticed that the performance of the following loop in lib/filterStorage.js gets worse with each update to the filter list:
function addSubscriptionFilters(subscription) { if (!FilterStorage.knownSubscriptions.has(subscription.url)) return; for (let filter of subscription.filters) filter.addSubscription(subscription); }
Note that this is not related to the changes for #6916, i.e. the behavior is the same both before and after the changes.
How to reproduce
- Use the Performance API to measure the time taken by the loop and print out the result to the console
- Manually update EasyList on the options page of the extension
Observed behaviour
Each time the loop takes slightly longer to execute. On my machine it's about 2ms longer each time (6ms, 8ms, 10ms, 12ms, 14ms, ...).
Expected behaviour
It should take approximately the same amount of time each time, especially on the second and subsequent updates.
Additional notes
This sort of thing normally points to a memory leak. If this is the case, it's going to be worse now because of the hourly updates to the ABP anti-circumvention filter list.
Resolution
Invalid.
This was based on an error in my testing.