[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-09-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet planned changes to this revision. kadircet added a comment. In D86077#2281218 , @sammccall wrote: > Just for the record, as I think Kadir and Adam are both aware... > > We discussed making this a bit richer and less reliant on static state. > We'd

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-09-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Just for the record, as I think Kadir and Adam are both aware... We discussed making this a bit richer and less reliant on static state. We'd build a tree-shaped profile by passing a tree-builder recursively into various components. Then the metrics would be exported a

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 8 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/TUScheduler.cpp:1309 +// fileStats results include ast cache sizes too, subtract them. +PreambleBytes -= ASTCacheBytes; + } adamcz wrote: > So

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 286043. kadircet marked an inline comment as done. kadircet added a comment. - Rename the overload - Add comments around possible caveats that might result in inaccuracies. - Move the metric recording itself into another thread. - Keep the calculations in the

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/TUScheduler.cpp:168 + size_t getUsedBytes() { +size_t TotalBytes = 0; nit: This is the same name as getUsedBytes(Key K). Maybe rename to getTotalUsedBytes()? Comment at:

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/TUScheduler.cpp:172 +for (const auto &Elem : LRU) + TotalBytes += Elem.second->getUsedBytes(); +return TotalBytes; adamcz wrote: > Any idea how expensive this is? I suppose TUSchedu

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/TUScheduler.cpp:172 +for (const auto &Elem : LRU) + TotalBytes += Elem.second->getUsedBytes(); +return TotalBytes; Any idea how expensive this is? I suppose TUScheduler::update() is r

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added reviewers: sammccall, adamcz. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, javed.absar. Herald added a project: clang. kadircet requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Introduces a