Skip to content

feat: support for max-depth, parallelize repo lookup#22

Merged
jrmoulton merged 2 commits intojrmoulton:mainfrom
PhilippHeuer:feat/perf-depth
Dec 9, 2023
Merged

feat: support for max-depth, parallelize repo lookup#22
jrmoulton merged 2 commits intojrmoulton:mainfrom
PhilippHeuer:feat/perf-depth

Conversation

@PhilippHeuer
Copy link
Contributor

@PhilippHeuer PhilippHeuer commented Oct 2, 2023

This presents an alternative approach to #20, enabling the specification of max-depth per source directory + tries to enhance the performance by using parallelization.

Changes Proposed

  • add --max-depth (-d) to config, example usage tms config --paths /src/rust /src/go -d 1 1
  • parallelize repo lookup using rayon
  • old configs should continue to work, the old search_paths will be merged into the new search_dirs if present
  • updated dependencies and fixed some typos

Additional Information

The len of --paths and --max-depth should match, but if it doesn't (tms config --paths /src/rust /src/go -d 1) then the max-depth for /src/go would default to 10.

Config-Example:

[[search_dirs]]
path = '/src/rust'
depth = 1

Disclaimer: I know nothing about rust, although the code works it's very possible that there are issues.

@jrmoulton
Copy link
Owner

Sorry I haven't gotten a chance to review this yet.

On first look this looks good but I'll dig more into it tomorrow

@jasonpanosso
Copy link

Would love this feature! Lately tms has been pretty slow for me, and I believe it's due to it searching far deeper than I care for it to

@jrmoulton
Copy link
Owner

Fixes #12.
Took me forever to get around to reviewing this. This is looking good to me. I pushed a commit to fix clippy and update some dependecies and now I'll merge this in. I haven't been able to figure out a good way to do automated testing (it is difficult to integrate into tmux), so I'lll test this for a few days and then publish a release to crates io. Thanks for the pr @PhilippHeuer!

@jrmoulton jrmoulton merged commit d94f17e into jrmoulton:main Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants