Skip to content

Consider taking advantage of git commit-graph #1101

@michielbdejong

Description

@michielbdejong

With git commit-graph, the query git log Musi on a repo like tosdr-snapshots becomes 42 faster:

crawler@ota-tosdr-ubuntu-20-04:~$ git clone https://github.com/tosdr/tosdr-snapshots
Cloning into 'tosdr-snapshots'...
remote: Enumerating objects: 325901, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 325901 (delta 0), reused 0 (delta 0), pack-reused 325900 (from 1)
Receiving objects: 100% (325901/325901), 1014.11 MiB | 23.45 MiB/s, done.
Resolving deltas: 100% (177325/177325), done.
Updating files: 100% (15036/15036), done.
crawler@ota-tosdr-ubuntu-20-04:~$ cd tosdr-snapshots/
crawler@ota-tosdr-ubuntu-20-04:~/tosdr-snapshots$ git --version
git version 2.46.0
crawler@ota-tosdr-ubuntu-20-04:~/tosdr-snapshots$ time git log Musi > /dev/null

real	0m36.150s
user	0m35.476s
sys	0m0.542s
crawler@ota-tosdr-ubuntu-20-04:~/tosdr-snapshots$ time git log Musi/* > /dev/null

real	0m37.725s
user	0m37.163s
sys	0m0.557s
crawler@ota-tosdr-ubuntu-20-04:~/tosdr-snapshots$ git commit-graph write --reachable --changed-paths
Computing commit changed paths Bloom filters: 100% (82187/82187), done.
crawler@ota-tosdr-ubuntu-20-04:~/tosdr-snapshots$ time git log Musi > /dev/null

real	0m0.847s
user	0m0.773s
sys	0m0.073s
crawler@ota-tosdr-ubuntu-20-04:~/tosdr-snapshots$ time git log Musi/* > /dev/null

real	0m38.458s
user	0m38.002s
sys	0m0.453s
crawler@ota-tosdr-ubuntu-20-04:~/tosdr-snapshots$ 

But as you can also see there, I haven't found a way yet to speed up the query git log Musi/* yet, so unless there is a way to speed that up too, it might be worth to try to avoid using wildcards in paths in git log commands? Will update here if I find out more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceWays to decrease resource usage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions