Skip to content

Evaluate total impact of template library #24

@stgatilov

Description

@stgatilov

First of all, thank you very much for C++ Build Insights!
I had to analyze build times in the past, but usually had to estimate template issues using object files (with SymbolSort).

I have a project, where Eigen template library was added recently. I'm trying to understand how much build time its template code takes. The same question can be asked for std::* code, boost::* or any other template library.


Parsing library headers is easy to take into account: open "Files" view, filter table data by "Included Path" containing "Eigen" as substring, then look at "Exclusive Duration" of root node "Parsing". Unfortunately, it is not easy to do the same for template instantiations.

First of all, vcperf removes some template instantiations, as noticed in #16. As far as I understand, the raw trace contains all template instantiations, but the analysis removes small ones to make analyzed trace smaller and more responsive when opened in WPA. I worked around this problem by hacking ExpensiveTemplateInstantiationCache::DetermineTopPrimaryTemplates.

Second, only "Duration" is displayed for template instantiations in WPA. It is inclusive, so it cannot be aggregated. I can workaround it by replacing td.WallClockTimeResponsibility with td.ExclusiveDuration in TemplateInstantiationsView::OnTemplateInstantiationStart. Perhaps ExclusiveCPUTime makes even more sense here.

The last inconvenience is that I don't know how to compute sum of column value over all selected/filtered entries in WPA table (except for copying everything to csv and writing simple script). The "Files" view allows summation by having "Activity Name" = "Parsing" key column, but there is no such column in "Template Instantiations" view. Perhaps the most useful additional key column would be "root namespace" (prefix of "Primary Template Name" before ::) like "Eigen", "std" or "boost".


Is it possible to configure the columns displayed in WPA views?
I see that I can add more fields in vcperf code, but WPA does not display them. I tried editing CppBuildInsightsEtw.xml, but it did not help.

P.S. I guess the best approach would be to write a custom analyzer which will aggregate data on-the-fly, without creating massive traces with all template instantiations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions