Opened on 11/04/2018 at 11:09:59 PM

Closed on 11/04/2018 at 11:30:02 PM

#7098 closed change (rejected)

Avoid writing to disk on each filter hit

Reported by: mjethani Assignee: mjethani
Priority: P2 Milestone:
Module: Core Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29936555/

Description (last modified by mjethani)

Background

In lib/filterListener.js, we are calling setDirty with a 0 argument, making it write to disk. This makes sense if the filter's hit count has been reset, but it doesn't make sense if it was already zero. To make it worse, the extension repeatedly calls the function with old and new values 0 and 0 respectively on each filter hit, causing repeated writes to the local storage.

What to change

If the value of the oldValue parameter is 0, don't call setDirty with 0, instead default to 0.002.

Additional notes

This might be why the extension is causing the browser to freeze up (#7065).

Resolution

After some testing, it seems we are not writing to disk on every filter hit. This is because isDirty is 0 so there is no write.

It might still be a good idea to add a check, but it's not necessary.

Attachments (0)

Change History (4)

comment:1 Changed on 11/04/2018 at 11:15:56 PM by mjethani

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed on 11/04/2018 at 11:17:35 PM by mjethani

  • Description modified (diff)

comment:3 Changed on 11/04/2018 at 11:21:10 PM by mjethani

  • Description modified (diff)

comment:4 Changed on 11/04/2018 at 11:30:02 PM by mjethani

  • Description modified (diff)
  • Resolution set to rejected
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from mjethani.
 
Note: See TracTickets for help on using tickets.