[PATCH] D42148: [CodeView] Speed up type iteration

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 16:42:48 PST 2018


zturner created this revision.
zturner added a reviewer: rnk.
Herald added a subscriber: hiraditya.

The abstractions in use for iterating over sequences of types are apparently slow.  This is not easy to fix, but it basically boils down to abstraction overhead.  The internal abstractions have several layers of pointer indirections and `shared_ptr` copies, which slows things down considerably considering this is in the hot path.

Going back to raw byte-level constructs speeds this up rather significantly, on the order of 10%-15% of total link time.  The particular test case here went from 41.6s (pre-patch) to 36s (post-patch), for a solid 15% improvement.


https://reviews.llvm.org/D42148

Files:
  lld/COFF/PDB.cpp
  llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
  llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42148.130065.patch
Type: text/x-patch
Size: 6698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180117/a01869e9/attachment.bin>


More information about the llvm-commits mailing list