This is an archive of the discontinued LLVM Phabricator instance.

[pdb] Don't verify TPI hash values up front
ClosedPublic

Authored by zturner on May 4 2017, 10:57 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner created this revision.May 4 2017, 10:57 AM
amccarth accepted this revision.May 4 2017, 1:37 PM
This revision is now accepted and ready to land.May 4 2017, 1:37 PM
This revision was automatically updated to reflect the committed changes.