[PATCH] D20724: [pdb] Apply zero-copy algorithms to symbol stream iteration

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 22:37:43 PDT 2016


zturner created this revision.
zturner added a reviewer: ruiu.
zturner added a subscriber: llvm-commits.

There is one PDB stream for each module (compiland).  This stream contains (among other things) all of the symbols for each compiland.  Generally speaking this is where a large portion of memory associated with the PDB lies.

This patch slightly improves the `VarStreamArray` class by templatizing it on a value type and changing the length conversion function to a value / length extraction function.  In doing so, we can now apply the `VarStreamArray` to symbol streams and iterate them exactly the same as before, but without copying the entire symbol stream into a contiguous buffer.

Measurements:
PDB File Size: 6,598,656 bytes
Combined size of all symbol streams: 1,985,508 bytes

So this is a savings of 30% of the PDB size.  We should be able to claim another 30% or so by applying this to the type info streams.

http://reviews.llvm.org/D20724

Files:
  include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
  include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
  include/llvm/DebugInfo/CodeView/RecordIterator.h
  include/llvm/DebugInfo/CodeView/StreamArray.h
  include/llvm/DebugInfo/CodeView/StreamReader.h
  include/llvm/DebugInfo/CodeView/SymbolDumper.h
  include/llvm/DebugInfo/CodeView/SymbolRecord.h
  include/llvm/DebugInfo/CodeView/TypeDumper.h
  include/llvm/DebugInfo/PDB/Raw/DbiStream.h
  include/llvm/DebugInfo/PDB/Raw/ModInfo.h
  include/llvm/DebugInfo/PDB/Raw/ModStream.h
  lib/DebugInfo/CodeView/SymbolDumper.cpp
  lib/DebugInfo/CodeView/TypeDumper.cpp
  lib/DebugInfo/PDB/Raw/DbiStream.cpp
  lib/DebugInfo/PDB/Raw/ModInfo.cpp
  lib/DebugInfo/PDB/Raw/ModStream.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20724.58755.patch
Type: text/x-patch
Size: 16478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160527/e1db8785/attachment.bin>


More information about the llvm-commits mailing list