Sublime Forum

String search in 100,000 files is slow

#1

I’m using Sublime Text 3.2.2 3211 (win64) to do something like grep -r 'SomeFuntionName' ., namely ‘Find in Files… Ctrl+Shift+F’.
For hundreds of files, it works fast and well.
However, occasionally I need to find something like a function definition in thousands of files, it can take much longer than expected even when all files are preloaded in memory.
Observed with taskmgr, when Sublime Text is doing the search, disk I/O is low, CPU usage about to one core, it looks like only a single thread is being used to run the search job.
Right now it takes 30 seconds to search 100,000 files. The total file size is about 3 GB.
Can it be configured to use more CPU cores for searching?

OS: Windows Server 2019.
Defender is uninstalled and no AV.
Machine is not connected to the Internet.
Files are a bunch of c/cpp source code.

Any suggestions would be appreciated.

0 Likes

#2

There is no such option as far as I’m aware, no. There are options for controlling the indexer, which finds symbols and their usages to allow for faster navigation, however.

You may want to try a portable installation of ST4 if you haven’t and see if that provides any better speed though. I can’t remember offhand if that was on the list of items, but a great many things were sped up so there may still be some gains.

0 Likes

#3

I am having the same issue searching a large number of code files. It’s caused by the delay over the VPN connection, for the indexing, after setting index_worker to be 30, it’s extremely fast, can’t complain.

However, there is no option to make the search in files in a parallel manner, it’s painful.

0 Likes

#4

find-in-files has been parallel since build 4130.

0 Likes