[llvm-bugs] [Bug 44293] New: weird InstantiateFunction timings with PCH

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 13 04:35:29 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=44293

            Bug ID: 44293
           Summary: weird InstantiateFunction timings with PCH
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Keywords: slow-compile
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: trass3r at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

I tested -ftime-trace on a minimal Catch2 setup on Windows (VS2019 Preview):
https://github.com/Trass3r/catch2test

set CC=clang
set CXX=clang++
cmake -G Ninja ..

When using PCH it mostly spends time instantiating functions in test.cpp of
course.
Oddly it reports most time (over 60ms) is spent on
std::_Hash_representation<float> which simply forwards to _Fnv1a_append_value
which only takes less than 1 ms:

{"pid":1,"tid":0,"ph":"X","ts":128232,"dur":689,"name":"InstantiateFunction","args":{"detail":"std::_Fnv1a_append_value<float>"}},{"pid":1,"tid":0,"ph":"X","ts":65113,"dur":63810,"name":"InstantiateFunction","args":{"detail":"std::_Hash_representation<float>"}},

Without PCH it needs 400 us:

{"pid":1,"tid":0,"ph":"X","ts":869250,"dur":239,"name":"InstantiateFunction","args":{"detail":"std::_Fnv1a_append_value<float>"}},{"pid":1,"tid":0,"ph":"X","ts":869082,"dur":409,"name":"InstantiateFunction","args":{"detail":"std::_Hash_representation<float>"}},

Maybe the timings are skewed by some PCH reading?
At least it is misleading when you are looking for optimization opportunities
and it points you at the wrong location.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191213/556df8ee/attachment.html>


More information about the llvm-bugs mailing list