OSDN Git Service

[PDB] Don't build the entire source file list up front.
authorZachary Turner <zturner@google.com>
Thu, 4 May 2017 23:53:29 +0000 (23:53 +0000)
committerZachary Turner <zturner@google.com>
Thu, 4 May 2017 23:53:29 +0000 (23:53 +0000)
commit505c76a9265490978516a09994a663b6c6fd4b0e
treeb393600f6f901ef2f3fb8e863c13b29d27f8b094
parentb18693c52dfe288124fd67fac8c20d7dce60d3ff
[PDB] Don't build the entire source file list up front.

I tried to run llvm-pdbdump on a very large (~1.5GB) PDB to
try and identify show-stopping performance problems.  This
patch addresses the first such problem.

When loading the DBI stream, before anyone has even tried to
access a single record, we build an in memory map of every
source file for every module.  In the particular PDB I was
using, this was over 85 million files.  Specifically, the
complexity is O(m*n) where m is the number of modules and
n is the average number of source files (including headers)
per module.

The whole reason for doing this was so that we could have
constant time access to any module and any of its source
file lists.  However, we can still get O(1) access to the
source file list for a given module with a simple O(m)
precomputation, and access to the list of modules is
already O(1) anyway.

So this patches reduces the O(m*n) up-front precomputation
to an O(m) one, where n is ~6,500 and n*m is about 85 million
in my pathological test case.

Differential Revision: https://reviews.llvm.org/D32870

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302205 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
include/llvm/DebugInfo/PDB/Native/DbiModuleList.h [new file with mode: 0644]
include/llvm/DebugInfo/PDB/Native/DbiStream.h
include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
include/llvm/DebugInfo/PDB/Native/RawTypes.h
include/llvm/Support/BinaryStreamArray.h
lib/DebugInfo/PDB/CMakeLists.txt
lib/DebugInfo/PDB/Native/DbiModuleList.cpp [new file with mode: 0644]
lib/DebugInfo/PDB/Native/DbiStream.cpp
lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp
lib/DebugInfo/PDB/Native/NativeEnumModules.cpp
lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp
tools/llvm-pdbdump/LLVMOutputStyle.cpp
tools/llvm-pdbdump/StreamUtil.cpp
tools/llvm-pdbdump/YAMLOutputStyle.cpp