Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Conversation

@varungandhi-src
Copy link
Contributor

@varungandhi-src varungandhi-src commented Jul 7, 2022

For an indexing job of CMake on a 60 core machine:

  • Before this change: indexing time 30s with about 31/60 core utilization
  • After this change: indexing time 25s with about 42/60 core utilization

There doesn't seem to be much effect on 16 core machines.

This was changed in upstream LLVM too (in clangd).
The code change to IndexerMain.cpp is redundant, because the code is
duplicated in LSIFClangMain.cpp, but we keep the two in sync.

Test plan

Manually tested

For an indexing job of CMake on a 60 core machine:
- Before this change: indexing time 30s with about 31/60 core utilization
- After this change:  indexing time 25s with about 42/60 core utilization

There doesn't seem to be much effect on 16 core machines.

This was changed in upstream LLVM too (in clangd).
The patch to IndexerMain.cpp is not used, because the code is
duplicated in LSIFClangMain.cpp, but we keep the two in sync.
@varungandhi-src
Copy link
Contributor Author

Looks like there was another optimization around files in the upstream commit which introduced this.

llvm/llvm-project@dad804a

@varungandhi-src
Copy link
Contributor Author

Updated benchmarks with the file optimization: (different 60 core instance)

  • Without any optimization: 34s, 403M index
  • With separate mutexes: 29s, 403M index
  • With file uniquing+skipping: 17s, 390M index

This cuts down build time further by about 40% for CMake.
@varungandhi-src varungandhi-src merged commit 1803591 into main Jul 7, 2022
@varungandhi-src varungandhi-src deleted the vg/reduce-contention branch July 7, 2022 06:51
jlisee pushed a commit to jlisee/lsif-clang that referenced this pull request Jul 8, 2022
…aph#85)

* lsif-clang: Reduce contention by using per-table mutexes.

For an indexing job of CMake on a 60 core machine:
- Before this change: indexing time 30s with about 31/60 core utilization
- After this change:  indexing time 25s with about 42/60 core utilization

There doesn't seem to be much effect on 16 core machines.

This was changed in upstream LLVM too (in clangd).
The patch to IndexerMain.cpp is not used, because the code is
duplicated in LSIFClangMain.cpp, but we keep the two in sync.

* lsif-clang: Add file skipping optimization from upstream patch.

This cuts down build time further by about 40% for CMake.

Practically a cherry-pick of 9cb00e7133ea3da6a49ade95e3708240c2aaae39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants