Closed Bug 2085860 Opened 22 days ago Closed 21 days ago

Speed up the `includes` linter

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

enhancement

Tracking

(firefox161 fixed)

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: ahochheiden, Assigned: ahochheiden)

References

(Blocks 1 open bug)

Details

Attachments

(4 external files, 1 obsolete file)

includes searches each file once per included header, with a regex of all that header's symbols.

includes searched every file once per included header, with a regex
joining all of that header's symbols. The lint_std_headers and
lint_cstd_headers checks from diskarzhan and the mfbt check all
searched this way. Every symbol is a plain identifier, so the linter now
collects the words of a file once and looks the symbols up in them. The
linter has its own copies of lint_std_headers and lint_cstd_headers,
which read the symbol tables from diskarzhan, and no longer calls the
diskarzhan versions. The results are the same as the regex search. A
whole tree mach lint -l includes on Windows went from 17 to 8 seconds.

Attachment #9668112 - Attachment is obsolete: true

This brings performance improvement to the include linter.

Attachment #9668423 - Attachment description: Bug 2085860 - Upgrade diskarzhan tot he latest revision r=ahochheiden → Bug 2085860 - Upgrade diskarzhan to the latest revision r=ahochheiden
Status: NEW → RESOLVED
Closed: 21 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch

check_mfbt_headers ran one regex per identifier for every mfbt header a
file includes. Every identifier in mfbt/api.yml is a plain word, so the
check now counts the words of a file once and looks the identifiers up in
those counts. The results match the regex search, and a whole tree
mach lint -l includes on Windows went from 9.7 to 8.7 seconds.

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

Attachment #9670829 - Attachment description: Bug 2085860 - Look up the mfbt header symbols in a set of each file's words r?#linter-reviewers → Bug 2085860 - Look up the mfbt header symbols in the word counts of each file r?#linter-reviewers
Attachment #9670829 - Attachment description: Bug 2085860 - Look up the mfbt header symbols in the word counts of each file r?#linter-reviewers → Bug 2085860 - Check the mfbt includes with `diskarzhan.lint_headers` r?#linter-reviewers

The test read a literal category, which mfbt/api.yml does not have,
so it never checked _KiB, _MiB or _percent.

This mostly contain speed upgrades, which will benefits our linting
process.

Thanks @ahochheiden for the upstream contribution!

Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d7df08cc48e4 https://hg.mozilla.org/integration/autoland/rev/b66c4b9b63e2 Check the mfbt includes with `diskarzhan.lint_headers` r=linter-reviewers,sergesanspaille,sylvestre
Regressions: 2091180
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: