[PATCH] D83755: [clangd] Cache config files for 5 seconds, without revalidating with stat.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 04:36:18 PDT 2020


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks, LGTM



================
Comment at: clang-tools-extra/clangd/ConfigProvider.cpp:24
 
+//
+
----------------
looks like an unwated artifact


================
Comment at: clang-tools-extra/clangd/ConfigProvider.cpp:103
+    MTime = Stat->getLastModificationTime();
+    updateCacheLocked(*FS, DC);
   }
----------------
nit: the rest of this function is also updating the cache now, maybe inline the function call?


================
Comment at: clang-tools-extra/clangd/ConfigProvider.h:41
+  /// If not set, providers should validate caches against the data source.
+  llvm::Optional<std::chrono::steady_clock::time_point> FreshTime;
 };
----------------
i would've suggested storing a duration here instead of time point, but as discussed offline this is only done once in the clangdserver and storing a time point might help with invalidating the cache based on filewatcher events easily.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83755/new/

https://reviews.llvm.org/D83755





More information about the cfe-commits mailing list