It may be as simple as telling VS Code not to index / search certain folders. Are there /vendor or /dist folders that you don't want to search through? Try this:
- Do one of your slow searches
- Look through the files that get returned
- See if there are files being returned in a folder you don't care about
For each of these folders, add them to the files.exclude section of your settings file:
"files.exclude": { "**/dist*": true, "**/node_modules*": true },
If there are any really large files that show up in the search, add those too.
The fewer files the search needs to deal with, the faster it will go.
Update Oct 2021
You should now use search.exclude instead of files.exclude, as files.exclude will remove the files from search, but will also remove the files from your file tree in the leftnav. search.exclude only filters them out of search.
"search.exclude": { "**/dist*": true, "**/node_modules*": true },
search.exclude. The files.exclude will remove the ide recognition entirely in the explorer.