ClangBuildAnalyzer | Clang build analysis tool using -ftime-trace | Compiler library
kandi X-RAY | ClangBuildAnalyzer Summary
kandi X-RAY | ClangBuildAnalyzer Summary
Clang build analysis tool using -ftime-trace
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ClangBuildAnalyzer
ClangBuildAnalyzer Key Features
ClangBuildAnalyzer Examples and Code Snippets
Community Discussions
Trending Discussions on ClangBuildAnalyzer
QUESTION
I am using the glm
library, which is a header-only collection of math utilities intended for 3D graphics. By using -ftime-trace
on Clang and ClangBuildAnalyzer
, I've noticed that a lot of time is being spent instantiating glm
types:
ANSWER
Answered 2020-May-13 at 22:16Unfortunately, there’s no way to avoid these instantiations. An explicit instantiation declaration of a class template doesn’t prevent (implicit) instantiation of that template; it merely prevents instantiating its non-inline, non-template member functions (which is often none of them!) because some other translation unit will supply the actual function symbols and object code.
It’s not that seeing the template definition causes instantiation (which specialization would be instantiated?). The reason is that code which requires that the class be complete still needs to know its layout and member function declarations (for overload resolution), and in general there’s no way to know those short of instantiating the class:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ClangBuildAnalyzer
Which files are slowest to parse? i.e. spend time in compiler lexer/parser front-end
Which C++ templates took the most time to instantiate?
Which files are slowest to generate code for? i.e. spend time in compiler backend doing codegen and optimizations
Which functions are slowest to generate code for?
Which header files are included the most in the whole build, how much time is spent parsing them, and what are the include chains of them?
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page