<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - weird InstantiateFunction timings with PCH"
href="https://bugs.llvm.org/show_bug.cgi?id=44293">44293</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>weird InstantiateFunction timings with PCH
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>slow-compile
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>trass3r@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>I tested -ftime-trace on a minimal Catch2 setup on Windows (VS2019 Preview):
<a href="https://github.com/Trass3r/catch2test">https://github.com/Trass3r/catch2test</a>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>