New issue
Advanced search Search tips

Issue 711764 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

style checker plugin has 5% compile time overhead on at least some files in blink

Project Member Reported by thakis@chromium.org, Apr 14 2017

Issue description

On my Windows box, I ran:

del out\gn\obj\third_party\WebKit\Source\core\svg\svg\SVGAnimatedAngle.obj
ninja -C out\gn third_party/WebKit/Source/core/svg -v -d keeprsp

And then

cd out\gn
..\..\..\..\tim\tim ..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /nologo /showIncludes /FC @obj/third_party/WebKit/Source/core/svg/svg/SVGAnimatedAngle.obj.rsp /c ../../third_party/WebKit/Source/core/svg/SVGAnimatedAngle.cpp /Foobj/third_party/WebKit/Source/core/svg/svg/SVGAnimatedAngle.obj /Fd"obj/third_party/WebKit/Source/core/svg/svg_cc.pdb"

(tim being C:\src\chrome\src\out\gn>..\..\..\..\tim\tim ..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /nologo /show
Includes /FC @obj/third_party/WebKit/Source/core/svg/svg/SVGAnimatedAngle.obj.rsp /c ../../third_party/WebKit/Source/cor
e/svg/SVGAnimatedAngle.cpp /Foobj/third_party/WebKit/Source/core/svg/svg/SVGAnimatedAngle.obj /Fd"obj/third_party/WebKit
/Source/core/svg/svg_cc.pdb")

This takes about 8s usually, but if I open the rsp file and remove `-Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-auto-raw-pointer` it takes about 7.6s. (Removing the blink gc plugin doesn't save anything, as it should.)

That's not good.
 

Comment 1 by dcheng@chromium.org, Apr 14 2017

This is without my patch to change banned directory checking in issue 706466, right?

Comment 2 by thakis@chromium.org, Apr 14 2017

I'm synced to #464540 and using the clang that comes with that bundled.

Comment 3 by dcheng@chromium.org, Apr 16 2017

I think part of this might be the fact that we're visiting vardecls, even in banned namespaces. I'm experimenting with a local CL that refactors how we do banned directory/namespace checking that I'm hoping will resolve this.

Comment 4 by thakis@chromium.org, Apr 17 2017

(see also issue 672115)

Comment 5 by dcheng@chromium.org, Apr 17 2017

Yeah, I saw the other bug. Sadly, my experiments show that this probably doesn't have a major effect (or even has the opposite effect).

Is there a good way to profile clang to see where the time is going?
Labels: TE-NeedsTriageHelp

Comment 7 by thakis@chromium.org, Apr 17 2017

Any profiler should work. (Instruments on Mac is good, I guess people use perf on Linux, and ETW on Windows.) Make sure to attach to the cc1 subprocess.

Comment 8 by dcheng@chromium.org, Apr 17 2017

This is with no changes:
dcheng@nausicaa:~/src/chrome/src$ ninja -C out/Release -t clean                                                                                                                                                              
ninja: error: remove(gen/chrome/browser/resources/safe_browsing/all): Directory not empty                                                                                                                    
ninja: error: remove(gen/chrome/browser/resources/settings/settings_resources.unpak): Directory notempty                                                                                    
Cleaning... 37908 files.                                                                                                                                                                        
dcheng@nausicaa:~/src/chrome/src$ time ninja -C out/Release chrome                                                                                                                        
ninja: Entering directory `out/Release'                                                                                                                                                                      
[31295/31295] LINK ./chrome                                                                                                                                                                                                   
                                                                                                                                                                                                                
real    48m33.806s                                                                                                                                                               
user    1807m34.716s                                                                                                                                                                                         
sys     72m17.232s     

And with the changes in https://chromium-review.googlesource.com/c/478907/ which were supposed to "help":
dcheng@nausicaa:~/src/chrome/src$ ninja -C out/Release -t clean                                                                                                                                                 
ninja: error: remove(gen/chrome/browser/resources/safe_browsing/all): Directory not empty                                                                                                           
ninja: error: remove(gen/chrome/browser/resources/settings/settings_resources.unpak): Directory notempty                                                                                                     
Cleaning... 37908 files.                                                                                                                                                                          
dcheng@nausicaa:~/src/chrome/src$ time ninja -C out/Release chrome                                                                                                                                             
ninja: Entering directory `out/Release'                                                                                                                                                                   
[31295/31295] LINK ./chrome                                                                                                                                                                                     
                                                                                                                                                                                     
real    49m8.400s                                                                                                                                                                                  
user    1803m14.484s                                                                                                                                                                                                                     
sys     97m18.408s 


I've tried profiling as well: with perf record + perf report off the binary generated by update.py:
- A lot of things aren't symbolized
- unmangling doesn't seem to work

Looking at the report, it reports 0.17% of build time is spent in libFindBadConstructs.so, which seems very little--so I'm surprised that the overall affect is about 0.5% when building Chrome. Maybe I'm interpreting the numbers incorrectly (I haven't done a baseline run with no plugin changes yet).

Comment 9 by thakis@chromium.org, Apr 17 2017

You can do a local RelWithDebInfo cmake build of clang to get more symbols, or add -g to your build flags similar to the cxxflags thingy in https://codereview.chromium.org/2709613004/diff/140001/tools/clang/scripts/update.py .
Project Member

Comment 10 by sheriffbot@chromium.org, Apr 18 2018

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment