[PATCH] D125103: [clangd] Speed up a slow sleeping testcase.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 6 09:25:37 PDT 2022


sammccall created this revision.
sammccall added a reviewer: ilya-biryukov.
Herald added subscribers: usaxena95, kadircet, arphaman, javed.absar.
Herald added a project: All.
sammccall requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang-tools-extra.

This testcase runs slowly due to 3.2s of sleeps = 2 + 1 + 0.2s.
After this patch it has 0.55s only.

Reduced by:

- observed that the last test was bogus: we were sleeping until the queue was idle, effectively just a second copy of the first test. This avoids 1s sleep.
- when waiting for debounce, sleep only until test passes, not for enough time to be safe (in practice was 2x debounce time, now 1x debounce time)
- scaling delays down by a factor of 2 (note: factor of 10 caused bot failures)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125103

Files:
  clang-tools-extra/clangd/support/Threading.cpp
  clang-tools-extra/clangd/support/Threading.h
  clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125103.427661.patch
Type: text/x-patch
Size: 4536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220506/ddc1f7e8/attachment.bin>


More information about the cfe-commits mailing list