[PATCH] D52503: [clangd] More precise index memory usage estimate

2018-09-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 167062. kbobyrev edited the summary of this revision. kbobyrev added a comment. - Prevent `sizeof(std::vector)` to be counted twice in the memory estimates - Pull memory usage logging to the caller side: it is currently incorrect because `Dex::BackingDataSi

[PATCH] D52503: [clangd] More precise index memory usage estimate

2018-09-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev added inline comments. Comment at: clang-tools-extra/clangd/index/dex/Dex.cpp:251 Bytes += InvertedIndex.getMemorySize(); - for (const auto &P : InvertedIndex) -Bytes += P.second.bytes(); + for (const auto &TokenToPostingList : InvertedIndex) +Bytes += Token

[PATCH] D52503: [clangd] More precise index memory usage estimate

2018-09-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/dex/Dex.cpp:251 Bytes += InvertedIndex.getMemorySize(); - for (const auto &P : InvertedIndex) -Bytes += P.second.bytes(); + for (const auto &TokenToPostingList : InvertedIndex) +Bytes += TokenTo

[PATCH] D52503: [clangd] More precise index memory usage estimate

2018-09-25 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev added inline comments. Comment at: clang-tools-extra/clangd/index/dex/Dex.cpp:251 Bytes += InvertedIndex.getMemorySize(); - for (const auto &P : InvertedIndex) -Bytes += P.second.bytes(); + for (const auto &TokenToPostingList : InvertedIndex) +Bytes += Token

[PATCH] D52503: [clangd] More precise index memory usage estimate

2018-09-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/dex/Dex.cpp:251 Bytes += InvertedIndex.getMemorySize(); - for (const auto &P : InvertedIndex) -Bytes += P.second.bytes(); + for (const auto &TokenToPostingList : InvertedIndex) +Bytes += TokenTo

[PATCH] D52503: [clangd] More precise index memory usage estimate

2018-09-25 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev created this revision. kbobyrev added reviewers: ioeric, sammccall. kbobyrev added a project: clang-tools-extra. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. This patch adds `Token`'s string data to the memory estimation. While it is only responsible for a couple of ex