Opened 11 months ago

Last modified 7 months ago

#6295 new defect

Adblock Plus for Safari is causing large amount of disk writes

Reported by: sb Assignee:
Priority: P3 Milestone:
Module: Platform Keywords:
Cc: sebastian, kzar, sergz, mani666 Blocked By:
Blocking: Platform: Safari
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kzar)

Environment

Mac OS X El Capitan 10.11.6, Safari 11.0.2, Adblock Plus 1.12.4

How to reproduce

  1. Open the macOS Task Manager, look for the "cfprefsd" task / process.
  2. Open Safari and browse to https://youtube.com
  3. Navigate to a few different videos

Observed behaviour

"cfprefsd" is performing large amounts of writes, several gigabytes in 30 minutes of browsing YouTube.

Expected behaviour

Less disk writing when using Adblock Plus with Safari.

Notes

  • The large writes only seem to happen when browsing websites with blocked ads.
  • It seems like the whole "com.apple.Safari.Extensions.plist" file (in ~/Library/Preferences/ is being written each time.
  • This could be a repeat of #6050, but this time for Safari. Perhaps if we backport the workaround that delayed updating the hit counter preference so often it would help.

Change History (6)

comment:1 Changed 10 months ago by sergz

  • Cc sebastian kzar sergz added

comment:2 Changed 10 months ago by kzar

  • Cc mani666 added
  • Component changed from Unknown to Platform
  • Description modified (diff)

Thanks for filing the issue, please could you confirm the macOS, Safari and Adblock Plus versions you're running? Also which filter subscriptions you have and which custom filters (if any). We can then attempt to reproduce and triage this for you.

Also you mentioned finding other users online with the same problem. If possible could you link those discussions so I can add them to the issue for some extra context.

Sounds like a repeat of #6050, but this time for Safari. Perhaps if we backport the workaround that delayed updating the hit counter preference so often it would help.

comment:3 Changed 10 months ago by kzar

  • Description modified (diff)

please could you confirm the macOS, Safari and Adblock Plus versions you're running

My bad, you already did at the bottom. Sorry I missed that.

comment:4 Changed 10 months ago by kzar

  • Description modified (diff)
  • Summary changed from Task cfprefsd massive writes to disk using Safari to Adblock Plus for Safari is causing large amount of disk writes

comment:5 Changed 7 months ago by user23948

I've noticed the same problem. Steps I took to verify:

  • In Safari's Extensions preferences, disable all extensions except Adblock Plus
  • Open a Safari window and navigate to https://www.nytimes.com/
  • Open Activity Monitor, select the tab “Disk”, and use the search field to search for “cfprefsd” (see: https://support.apple.com/en-us/HT201464#disk)
  • In Safari, reload the browser window a few times, and in Activity Monitor, observe the “bytes written” for “cfprefsd” (wait for it to stop increasing after each reload)

Here's the evolution of “bytes written”, in my case, after each page reload: 1.06GB; 1.18GB; 1.28GB; 1.37GB; 1.44GB.

  • Next, in Safari's Extensions preferences, also disable Adblock Plus
  • Again, reload the browser window a few times and observe Activity Monitor

In my case, “bytes written” by “cfprefsd” stayed at 1.44GB.

So, AdBlock Plus seems to be what's causing “cfprefsd” to write around 0.1GB each time the page is reloaded.

I also suspect that this is, as mentioned in the “Notes” above, because Adblock Plus is causing multiple rewrites of the file “com.apple.Safari.Extensions.plist” (located in ~/Library/Preferences). In my case, this file is around 33MB. Some extensions seem to be storing several MBs of data in this file, including Adblock Plus: if I make a copy of the file and edit it (in Xcode) by removing the root entries except for the “org.adblockplus” one, the new file is still 16MB.

Version information: macOS 10.13.4, Safari 11.1, Adblock Plus 1.12.4.

comment:6 Changed 7 months ago by kzar

  • Priority changed from Unknown to P3
  • Ready set
Note: See TracTickets for help on using tickets.