[PATCH] D32873: [pdb] Don't verify TPI hash values up front

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 10:57:46 PDT 2017


zturner created this revision.

Verifying the hash values requires iterating every type record before the user even tries to access the first type record.

In the dumper, for example, this leads to all records being iterated twice.  Once to verify the hashes, which the dumper has no control over, and again to actually dump them.  It's expensive twice because each instance deserializes the entire record from scratch.  In a large PDB file I tested with, I gave up after 5 minutes of just trying to verify hashes, and it hadn't even finished the first loop yet.

If we raise the verification outside of the `TpiStream` class and leave it up to the user, we can just add the `TpiHashVerifier` visitor to the same pipeline, so they can be verified at the same time as we dump them, with only a single walk of the type list.

This still won't address the fact that even doing it once is slow, but at least it reduces the number of full O(n) scans of the type record list from 2 to 1.


https://reviews.llvm.org/D32873

Files:
  llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
  llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
  llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32873.97852.patch
Type: text/x-patch
Size: 5273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170504/57ac937d/attachment.bin>


More information about the llvm-commits mailing list