ignore: Avoid contention on num_pending

Previously, every worker would increment the shared num_pending count on
every new work item, and decrement it after finishing them, leading to
lots of contention.  Now, we only track the number of workers actively
running, so there is no contention except when workers go to sleep or
wake up.

Closes #2642
This commit is contained in:
Tavian Barnes
2023-10-30 15:56:08 -04:00
committed by Andrew Gallant
parent af55fc2b38
commit 6d7550d58e
2 changed files with 22 additions and 25 deletions

View File

@@ -23,6 +23,8 @@ Performance improvements:
Make most searches with `\b` look-arounds (among others) much faster.
* [PERF #2591](https://github.com/BurntSushi/ripgrep/pull/2591):
Parallel directory traversal now uses work stealing for faster searches.
* [PERF #2642](https://github.com/BurntSushi/ripgrep/pull/2642):
Parallel directory traversal has some contention reduced.
Feature enhancements: