Investigate which prefs are read over and over that could benefit from an observer or caching

RESOLVED FIXED

Status

()

Core
General
RESOLVED FIXED
5 months ago
4 months ago

People

(Reporter: Felipe, Assigned: Felipe)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Assignee)

Description

5 months ago
Many prefs are read many times over and they never change value, or very rarely. A pref read implies in a string hash lookup so maybe the biggest offenders would provide value to be cached.

I'm not planning on landing code in the tree for this, just adding debugging locally and using a custom build for a while to get this data.

I've got something barebones working for this
(Assignee)

Comment 1

5 months ago
Created attachment 8853522 [details]
most-read-prefs.txt

Ok, here's a sorted list of the most repeatedly-read prefs in a 5min session on my profile, doing some light browsing.

All these prefs always returned the same value and never changed.

I think at least some of these would be nice improvements, specially layout.css.devPixelsPerPx and the urlclassifier.* ones since the urlclassifier blocks the network channel (and those are char prefs which implies in string copies).

Feel free to file bugs for these as you see fit.
(Assignee)

Comment 2

5 months ago
Created attachment 8853525 [details]
most-bytes-read.txt

And by bytes read, from the char prefs
(Assignee)

Comment 3

5 months ago
Created attachment 8853527 [details] [diff] [review]
log-pref-reads.patch

Patch used to log this info
(Assignee)

Comment 4

5 months ago
Created attachment 8853531 [details]
script.js

Script used to parse the data and generate the summaries
(Assignee)

Comment 5

5 months ago
Alright, my work here is done! Feel free to file bugs for things that are deemed worth it.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
(Assignee)

Updated

4 months ago
Depends on: 1353493
Depends on: 1353853
Thank you *so much* for doing this, Felipe!
Depends on: 1355548
Depends on: 1355631
I went through the list and file some more bugs. The rest don't look they are on the hot path so I will leave them as is.
You need to log in before you can comment on or make changes to this bug.