Closed
Bug 1188411
Opened 9 years ago
Closed 1 year ago
[Meta] Find and remove unused preferences
Categories
(Core :: General, task)
Tracking
()
RESOLVED
DUPLICATE
of bug 1773039
People
(Reporter: BenWa, Unassigned)
Details
(Keywords: good-first-bug, meta)
Attachments
(3 files)
We have a several preferences (about:config) that have been removed but are still around. I don't have any idea how many preferences are unused but it comes up from time to time.
A good first bug/mentored bug for someone good with scripting-foo would be to:
- Build a list of preference that occur in our preference files like all.js, b2g.js, firefox.js, mullet.js, etc...
- Find which of these preferences only appear in preference files.
- File follow-up bugs (either per preference or per pref component group) saying which preference is unused.
- (Optional) Post patch in these follow-up bugs (or let others do them).
Ideally we can have a reusable script to make this easier in the future.
Comment 1•9 years ago
|
||
Hi Benoit,
I want to work on this bug. Could you explain me a lit bit detailed what needs to be done in those steps:
> - Build a list of preference that occur in our preference files like all.js, b2g.js, firefox.js, mullet.js, etc...
> - Find which of these preferences only appear in preference files.
Thank you a lot
Flags: needinfo?(bgirard)
Reporter | ||
Comment 2•9 years ago
|
||
Here's a command you can run to get a list of preference files:
find . -name "*.js" | xargs grep -l ^pref\(.*\) 2> /dev/null | sort | uniq
Here's the result of the command against my checkout.
We want to find preference names that only occur in these files in the tree and no where else (non preference js files, c++ code, or any other file). These should be unused preferences.
Flags: needinfo?(bgirard)
Comment 3•9 years ago
|
||
Sorry, I forgot this issue due I was not assigned, so didn't appear in my dashboard.
Could I attach here an script to find those preferences and after I got it complete with your feedback, start creating the follow-ups bugs?
Thanks
Flags: needinfo?(bgirard)
Reporter | ||
Comment 4•9 years ago
|
||
Yes that would be great. By posting the script we can re-run it from time to time.
Note that I'm not absolutely sure that we have unused preferences but I'd say it's fairly likely that we do.
Flags: needinfo?(bgirard) → needinfo?(gioyik)
Updated•9 years ago
|
Assignee: nobody → gioyik
Flags: needinfo?(gioyik)
Comment 5•9 years ago
|
||
Thanks for the fast answer. Early tomorrow I will attach it. :)
Hello,
We are three students and we would like to work on this bug.
Is this still up ?
Comment 7•9 years ago
|
||
I tried to find a solution to this bug, but it seems very hard (if not impossible).
I wrote a script, which is attached, and it finds 1166 prefs! When I investigate it more deeply, I found that I can't find out if a preference is used by simply searching its string. As an example, nsHttpHandler defined the preferences in Macros:
https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpHandler.cpp#277
And there's a lot of other usages like this.
What do you think Benoit? If you have any ideas, I will be happy to try it out.
Flags: needinfo?(bgirard)
Reporter | ||
Comment 8•9 years ago
|
||
Flags: needinfo?(bgirard)
Reporter | ||
Comment 9•9 years ago
|
||
Yes I think you're right. However when you sort the results I think a lot of these preferences have a common prefix we could maybe just had to an ignore list in the script for now.
For instance the vast majority have the prefix:
font.name.*
Already a few preference stick out such as 'gfx.prefer-mesa-llvmpipe' which is now a dead preference. Once we start going through it I don't think it will take too much time.
Comment 10•9 years ago
|
||
I took the bug. I will look through it to see what can I done.
Assignee: gioyik → aidin
Updated•8 years ago
|
Assignee: aidin → nobody
Updated•7 years ago
|
Comment 11•7 years ago
|
||
As well as removing unused prefs, we can also convert some prefs to code constants. Bug 1414150 did this for a few prefs.
Updated•7 years ago
|
Updated•6 years ago
|
Type: defect → task
Updated•5 years ago
|
Keywords: good-first-bug
Whiteboard: good first bug
Comment 12•2 years ago
|
||
Oops; I filed Bug 1773039 because I hadn't found this one in my search.
Updated•2 years ago
|
Severity: normal → S3
Comment 13•1 year ago
|
||
I think this can be closed now. New work is being done in bug 1773039
Flags: needinfo?(ghess)
Updated•1 year ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•