alerque / git-warp-time

Rust library and CLI utility to reset timestamps of Git repository files to the time of the last modifying commit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Paralellize operations

alerque opened this issue · comments

The whole process of iterating files and walking their history to find the last change timestamps is completely serial right now. This works fine for most repositories, but I've run into a few that are much too slow. I have one with a combination of thousands of files of files with their last touched timestamps frequently thousands of commits deep, and waiting 20-40 seconds for some time warp action is excessive.

This should be an easy problem to setup multi-threading for. Probably computing the file list would be in one thread, then walking the history for each could be split up with at least one thread per core.

Since I'd been considering switching from libgit2 to gitoxide anyway I thought maybe doing that switch first before introducing parallelization would be the easy way to go, but having hacked on #8 a bit now I'm not so sure. I'd also be happy to see this happen with the current linked libgit2 library as well.

I'm open to ideas or contributions.