Closed
Bug 1501903
Opened 6 years ago
Closed 6 years ago
inThirdPartyPath has a large overhead
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox64 fixed, firefox65 fixed)
RESOLVED
FIXED
mozilla65
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(2 files)
46 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
46 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
About half the build time regression from enabling the clang plugin (see bug 1500274 comment 7) can be attributed to NonParamInsideFunctionDeclChecker and a perf profile from an complete build attributes a large amount of time spent in inThirdPartyPath.
Assignee | ||
Comment 1•6 years ago
|
||
It's even possible the rest of the build time regression is essentially due to inThirdPartPath too, because there are code paths using it that don't involve the NonParamInsideFunctionDeclChecker. As a matter of fact, the overhead from using the clang-plugin on Windows is even larger than on Linux, and it appears there's a code path leading to inThirdPartyPath from the Windows-only LoadLibraryUsageChecker.
Summary: NonParamInsideFunctionDeclChecker has a large overhead → inThirdPartyPath has a large overhead
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → mh+mozilla
Assignee | ||
Comment 2•6 years ago
|
||
Looking at the source locations inThirdPartyPath is called for when building a file I picked semi-randomly (Unified_cpp_memory_build0.o), I can see it's called a lot of times for a very few number of different files. And for each of them, it scans the whole MOZ_THIRD_PARTY_PATHS list, because in most cases, the paths do not belong to third party directories. For instance, for that specific file, there are 4073 calls to inThirdPartyPath for only 75 unique paths.
Assignee | ||
Comment 3•6 years ago
|
||
SourceLocation that are passed to inThirdPartyPath might be macro
expansion locations, for which SourceManager.getFilename returns the
path of the directory containing the source, rather than of the
expansion location.
Furthermore, the paths getFileName returns are not canonical, and can
contain e.g. `..`.
Assignee | ||
Comment 4•6 years ago
|
||
The function is called a lot for the same paths and is rather costly, so
cache the results for each path.
Depends on D9758
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/20af1d9ed3cd
Properly handle paths in inThirdPartyPath. r=andi
https://hg.mozilla.org/integration/autoland/rev/1adc093c7842
Cache the results of inThirdPartyPath. r=andi
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/20af1d9ed3cd
https://hg.mozilla.org/mozilla-central/rev/1adc093c7842
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Comment 7•6 years ago
|
||
bugherder |
Assignee | ||
Comment 8•6 years ago
|
||
Comment on attachment 9019960 [details]
Bug 1501903 - Properly handle paths in inThirdPartyPath.
[Beta/Release Uplift Approval Request]
Feature/Bug causing the regression: Bug 1486554
User impact if declined: This is required for the second patch in this bug.
Is this code covered by automated tests?: Yes
Has the fix been verified in Nightly?: Yes
Needs manual test from QE?: Yes
If yes, steps to reproduce:
List of other uplifts needed: None
Risk to taking this patch: Low
Why is the change risky/not risky? (and alternatives if risky):
String changes made/needed:
Attachment #9019960 -
Flags: approval-mozilla-beta?
Assignee | ||
Comment 9•6 years ago
|
||
Comment on attachment 9019961 [details]
Bug 1501903 - Cache the results of inThirdPartyPath.
[Beta/Release Uplift Approval Request]
Feature/Bug causing the regression: Bug 1486554
User impact if declined: Bug 1486554 caused some serious build time regressions on Windows, caused by enabling the clang plugin. This doesn't affect the code generated by Firefox, but changes some static analysis checks.
Is this code covered by automated tests?: Yes
Has the fix been verified in Nightly?: Yes
Needs manual test from QE?: Yes
If yes, steps to reproduce:
List of other uplifts needed: None
Risk to taking this patch: Low
Why is the change risky/not risky? (and alternatives if risky):
String changes made/needed:
Attachment #9019961 -
Flags: approval-mozilla-beta?
Assignee | ||
Comment 10•6 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #8)
> Comment on attachment 9019960 [details]
> Bug 1501903 - Properly handle paths in inThirdPartyPath.
The new form completely failed on me... it didn't ask most of those questions.
> [Beta/Release Uplift Approval Request]
>
> Feature/Bug causing the regression: Bug 1486554
>
> User impact if declined: This is required for the second patch in this bug.
>
> Is this code covered by automated tests?: Yes
>
> Has the fix been verified in Nightly?: Yes
>
> Needs manual test from QE?:
No
> If yes, steps to reproduce:
>
> List of other uplifts needed: None
>
> Risk to taking this patch:
Low
> Why is the change risky/not risky? (and alternatives if risky):
This doesn't affect the code generated by Firefox, but changes some static analysis checks.
> String changes made/needed:
N/A
Assignee | ||
Comment 11•6 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #9)
> Comment on attachment 9019961 [details]
> Bug 1501903 - Cache the results of inThirdPartyPath.
>
> [Beta/Release Uplift Approval Request]
>
> Feature/Bug causing the regression: Bug 1486554
>
> User impact if declined: Bug 1486554 caused some serious build time
> regressions on Windows, caused by enabling the clang plugin. This doesn't
> affect the code generated by Firefox, but changes some static analysis
> checks.
>
> Is this code covered by automated tests?: Yes
>
> Has the fix been verified in Nightly?: Yes
>
> Needs manual test from QE?:
No
> If yes, steps to reproduce:
>
> List of other uplifts needed: None
>
> Risk to taking this patch:
Low
> Why is the change risky/not risky? (and alternatives if risky):
This doesn't affect the code generated by Firefox, but changes some static analysis checks.
> String changes made/needed:
N/A
Comment 12•6 years ago
|
||
Comment on attachment 9019960 [details]
Bug 1501903 - Properly handle paths in inThirdPartyPath.
[Triage Comment]
Fixes a Windows build time regression when the clang static analysis checks were moved into the build jobs. Approved for 64.0b5.
Attachment #9019960 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Updated•6 years ago
|
Attachment #9019961 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 13•6 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/a186639fc5c5
https://hg.mozilla.org/releases/mozilla-beta/rev/2058a60f13a7
status-firefox64:
--- → fixed
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•