<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - FoldingSetNodeID::AddPointer is unnecessarily slow"
href="https://llvm.org/bugs/show_bug.cgi?id=24643">24643</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>FoldingSetNodeID::AddPointer is unnecessarily slow
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</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>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Support Libraries
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ben.craig@codeaurora.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>FoldingSetNodeID houses the hash and equality material for FoldingSet's
intrusive hash map data structure. The raw material is stored as a
SmallVector<unsigned, 32>. The current implementation of AddPointer does a
ranged append, like so...
Bits.append(reinterpret_cast<unsigned *>(&Ptr),
reinterpret_cast<unsigned *>(&Ptr+1));
This is done in order to support 32-bit and 64-bit pointers. Unfortunately,
SmallVector::append with 1 element is slower than SmallVector::push_back with 1
element. Append with 2 elements is also slower than two push_backs.
On MSVC, the append call eventually turns into a memmove + some bookkeeping.
With push_back, it turns into a memcpy + some bookkeeping.
When using the Clang static analyzer, AddPointer ends up being one of the top
hits for exclusive / self time.</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>