Skip to content
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

Stop traversal at maxdepth #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mneudert
Copy link

@mneudert mneudert commented Dec 6, 2017

Hi!

As a somewhat heavy user of gitcheck I regularly found that the "first check of the day" took rather long. Turns out that the maxdepth parameter was not applied to the actual traversal but only the output.

This PR is a proposal to change that behaviour. It is especially useful when having "cold storage" like after a system restart.

For reference I have measured some timings for my system (the separate number is the number of directories check if it is a git repository).

## master (cold storage)
> gitcheck --maxdepth 2 --quiet --dir=/data/projects
40392
2.38s user 2.45s system 19% cpu 24.155 total

## master (hot storage)
> gitcheck --maxdepth 2 --quiet --dir=/data/projects
40392
1.64s user 1.28s system 87% cpu 3.332 total

## traversal (cold storage)
> gitcheck --maxdepth 2 --quiet --dir=/data/projects
199
1.24s user 1.17s system 86% cpu 2.800 total

## traversal (hot storage)
> gitcheck --maxdepth 2 --quiet --dir=/data/projects
199
1.04s user 0.85s system 81% cpu 2.327 total

Your mileage obviously varies as both the directory count and timings depend on the type of disk used but it should generally be faster.

@mneudert mneudert force-pushed the stop-traversal-at-maxdepth branch from fbfef71 to c22027d Compare May 19, 2019 11:06
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.

1 participant