<div dir="ltr">It is possible to do it faster if the miss rate is high, and the hash function is expensive.<div>Otherwise, it's not.</div><div><div><br><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 11, 2016 at 1:39 PM, Rui Ueyama via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ruiu added a comment.<br>
<br>
I think this is going to be used in a speed critical path. I'm wondering if this is the fastest way to merge debug types -- one hash table lookup for each derived type may be a bit slow. But at least I don't come up with a better way, so hash table lookup might be unavoidable.<br>
<br>
<br>
================<br>
Comment at: include/llvm/DebugInfo/CodeView/MemoryTypeTableBuilder.h:62<br>
@@ -62,3 +61,3 @@<br>
std::vector<std::unique_ptr<Record>> Records;<br>
std::unordered_map<llvm::StringRef, TypeIndex, RecordHash> HashedRecords;<br>
};<br>
----------------<br>
Why don't you use DenseMap?<br>
<br>
================<br>
Comment at: lib/DebugInfo/CodeView/TypeStreamMerger.cpp:38-39<br>
@@ +37,4 @@<br>
+///<br>
+/// - Begin with a new empty stream, and a new empty hash table that maps from<br>
+/// type record contents to new type index.<br>
+/// - For each new type stream, maintain a map from source type index to<br>
----------------<br>
It doesn't look like you are using hash table, but instead you are using vectors to map indices.<br>
<br>
Ah, so the hash table is in MemoryTypeTableBuilder.h?<br>
<br>
<br>
<a href="http://reviews.llvm.org/D20122" rel="noreferrer" target="_blank">http://reviews.llvm.org/D20122</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div></div></div></div>