This is an archive of the discontinued LLVM Phabricator instance.

Save memory in ASTReader by using DenseMap instead of vector
Needs ReviewPublic

Authored by yamaguchi on Nov 5 2018, 3:43 AM.

Details

Reviewers
rsmith
Summary

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.