jrmoulton/tmux-sessionizer

Specify max search depth?

Closed this issue · 1 comments

Setting a search path to a folder containing a lot of files and directories makes the search slow (about 2-3 seconds). The search path is targeted to a directory containing a lot of project files for Unity. Therefore there is a lot of files and directories. By looking at the source code it seems to be a recursive search. How can I improve the performance of the search?

I thought maybe it could be specified by some max depth to search. For instance in my scenario tms only needs to search the children directories of the parent directory for a git repository, I don't care if there are any sub-projects.

I don't know rust, but it might be kind of difficult to implement, since the depth should probably be stored per search path, which means that every search path needs their own settings. That might be undesired since it introduces some complexity. What are your thoughts?

It shouldn't add too much complexity and this would be a good thing to implement. The maybe challenging part would be to ensure that the config structure remains compatible so that people don't have to re-create their configs.

I'll probably get around to implementing this in the 1-2 weeks (I should also set up building pre-built binaries on releases).

One way around this that is already built in is to just exclude folders that match the folders inside of unity that you want to exclude