[PATCH] D54097: Save memory in ASTReader by using DenseMap instead of vector

Yuka Takahashi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 03:43:15 PST 2018


yamaguchi created this revision.
yamaguchi added a reviewer: rsmith.

ReadASTBlock was allocating extra memory by resizing vector for all
record decls, and half of them stayed nullptr without being loaded. For
us this part was crucial and this patch had large amount of memory
improvement.

About clang performance regression, I run whole clang test 5 times
with and without this patch and took average:
Without patch: 239.43400000000003
With patch : 238.862
So I think this doesn't cause cpu time regression.


https://reviews.llvm.org/D54097

Files:
  clang/include/clang/Serialization/ASTReader.h
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTReaderDecl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54097.172563.patch
Type: text/x-patch
Size: 10875 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181105/9feb05c7/attachment.bin>


More information about the cfe-commits mailing list