-
Notifications
You must be signed in to change notification settings - Fork 31.9k
feature: make number of ripgrep threads configurable #213511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: make number of ripgrep threads configurable #213511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but unit test failures need fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Just some comments.
src/vs/workbench/services/search/node/ripgrepTextSearchEngine.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrea Mah <31675041+andreamah@users.noreply.github.com>
Co-authored-by: Andrea Mah <31675041+andreamah@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be the last round of comments, thanks so much for making changes so quickly!
src/vs/workbench/services/search/common/searchExtTypesInternal.ts
Outdated
Show resolved
Hide resolved
@ILogService _logService: ILogService, | ||
) { | ||
super(extHostRpc, _uriTransformer, _logService); | ||
|
||
const outputChannel = new OutputChannel('RipgrepSearchUD', this._logService); | ||
this._disposables.add(this.registerTextSearchProvider(Schemas.vscodeUserData, new RipgrepSearchProvider(outputChannel))); | ||
this._numThreadsPromise = _configurationService.getConfigProvider().then(provider => provider.getConfiguration('search').get<number>('ripgrep.numThreads')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested this out, and it seems that it won't update correctly if I change the setting. This is probably because the configuration is initialized once here and isn't updated when changed. I think you should be able to listen to onDidChangeConfiguration
on ExtHostConfigProvider
to listen for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I changed it to read the configuration value when the search starts so that always the latest configuration value is used.
Should
numThreads ?
|
I noticed that the string of added args ends up being |
I see both work on |
Yes, great find! I added the property there also! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for sticking with me on all my requested changes 🚀
fixes #206030.
Testing
For testing, I used the process explorer to see the ripgrep args being used, e.g. if the
--threads
argument is passed correctly toripgrep
.With many threads
In
settings.json
,search.threads
is commented out. By default, multiple threads are used. The ripgrep cli args don't include the--threads
option:With one thread
In
settings.json
,search.threads
is set to 1. The ripgrep cli args include--threads 1
: