Skip to content

Initial clone takes FOREVER, suggest depth argument #3005

@codefaux

Description

@codefaux

Hi there. Amazing work, love it.

I'm deploying a new DNS server, and wanted to use this repo for my current attempt.

My testbed was an RPi and it took FOREVER to do the first 'git clone' of the repo. Thinking it was "SD card slowdown" I decided to abort and move it onto my USB-C NVME SSD. It was only vaguely faster. I assumed it was a CPU horsepower thing.

Today, I deployed it on my primary workhorse, and was shocked to find it was the same.

I suggest a note for users to use a depth argument for deployments, if they're going to use the repo directly. The argument essentially ignores anything older than the specified depth, thus reducing the object count by more than several orders of magnitude.

I know this may not be the "ideal intended means" of deploying your hosts data, but I've seen several dozen scripts include this repo via git clone and I feel like it could be a welcome find for some folks. Even if it's just a closed issue, it's more easily discovered, so I figured I'd put it here.

PS, the time git clone command I started before typing this Issue out is at 23% and I have gigabit internet and a moderately competitive workstation running NVME SSDs; the slowdown is very real regardless of hardware spec.

Adding depth 1, to only retrieve the current version:

[faux@Hostname docker/coredns]$ time git clone --depth 1 https://github.com/StevenBlack/hosts.git
Cloning into 'hosts'...
remote: Enumerating objects: 341, done.
remote: Counting objects: 100% (341/341), done.
remote: Compressing objects: 100% (278/278), done.
remote: Total 341 (delta 78), reused 267 (delta 60), pack-reused 0 (from 0)
Receiving objects: 100% (341/341), 5.28 MiB | 1.07 MiB/s, done.
Resolving deltas: 100% (78/78), done.

real	0m7.093s
user	0m0.699s
sys	0m0.181s

And with no depth argument:

[faux@Hostname docker/coredns]$ time git clone https://github.com/StevenBlack/hosts.git
Cloning into 'hosts'...
remote: Enumerating objects: 89363, done.
remote: Counting objects: 100% (734/734), done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 89363 (delta 693), reused 518 (delta 518), pack-reused 88629 (from 4)
Receiving objects: 100% (89363/89363), 1.49 GiB | 1.17 MiB/s, done.
Resolving deltas: 100% (56795/56795), done.

real	22m53.063s
user	4m56.170s
sys	0m24.311s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions