kadircet added a comment.

LG, thanks!



================
Comment at: clangd/ClangdLSPServer.cpp:218
+        log("--> reply:{0}({1}) {2:ms}", Method, ID, Duration);
+        std::lock_guard<std::mutex> Lock(Server->TranspWriter);
+        if (TraceArgs)
----------------
Move locking below to not lock while copying reply.


================
Comment at: clangd/ClangdLSPServer.cpp:221
           (*TraceArgs)["Reply"] = *Reply;
-        else {
-          auto Err = Reply.takeError();
+        Server->Transp.reply(std::move(ID), std::move(Reply));
+      } else {
----------------
What about also printing vlog after sending out reply? Because for "heavy" 
replies there is a huge difference between process time and serialization of 
response to json, sometimes it might help to see how much time is spent for 
serialization as well.(for example ycmd patch, it takes a few hundred ms to 
prepare reply, but then a few seconds to dump it)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53647



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to