Strip comments out of default prefs files
Categories
(Core :: Preferences: Backend, enhancement)
Tracking
()
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(3 files)
On my Linux64 machine greprefs.js is about 220KB. With the comments stripped out, it's slightly less than half of that. We preprocess these files with preprocessor.py anyway, so when we do that we should strip out comments. This will reduce the size of the omnijar and reduce file loading & parsing time at process (chrome and content) startup.
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
It's not used, probably because it's pretty strange and hard to imagine using
safely. (Stripping leading and trailing space could be useful, but collapsing
sequences of spaces? Hmm.)
Assignee | ||
Comment 2•4 years ago
|
||
This commit does the following.
-
Renames
slashslash
asdumbComments
. As a result, it now comes before
emptyLines
in alphabetical ordering, which means that if you apply both
dumbComments
andemptyLines
, lines that contain only comments will be
fully removed.(I contemplated changing the filter ordering to match the order specified,
rather than using alphabetical ordering, but that was more invasive and not
obviously better.) -
Changes
dumbComments
so it only applies if the comment is at the start of
the line (with optional leading whitespace). This is so it can be used with
prefs files, which contain lines likepref("foo", "https://mozilla.org");
where the//
must not be treated as a comment.
Note that slashslash
wasn't being used anywhere.
Depends on D88240
Assignee | ||
Comment 3•4 years ago
|
||
For a local build on my Linux64 box, this reduces greprefs.js from 174,906
bytes to 103,221 bytes, and firefox.js from 112,100 bytes to 68,656 bytes.
Depends on D88242
Pushed by nnethercote@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/76efaf59feb8 Remove the `spaces` filter from preprocessor.py. r=glandium https://hg.mozilla.org/integration/autoland/rev/bcc9e11ca06b Change the `slashslash` filter in preprocessor.py. r=glandium https://hg.mozilla.org/integration/autoland/rev/328067bcffe8 Filter full-line comments and empty lines from prefs files. r=glandium,geckoview-reviewers,snorp
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/76efaf59feb8
https://hg.mozilla.org/mozilla-central/rev/bcc9e11ca06b
https://hg.mozilla.org/mozilla-central/rev/328067bcffe8
Updated•4 years ago
|
Description
•