10000 [v6-exp] New performance focused clone example + forward ports by pjbgf · Pull Request #1255 · go-git/go-git · GitHub
[go: up one dir, main page]

Skip to content

[v6-exp] New performance focused clone example + forward ports #1255

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

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

pjbgf
Copy link
Member
@pjbgf pjbgf commented Dec 19, 2024

pjbgf and others added 7 commits December 18, 2024 22:17
This example focuses on the least consumptiong of memory, while also
taking into account the total operation time.

The go-git compared to its git CLI counterpart:

go run _examples/clone/fast/main.go https://github.com/go-git/go-git /tmp/go-git-clone
GIT_TRACE_PERFORMANCE=true git clone --no-tags --depth 1 --single-branch https://github.com/go-git/go-git /tmp/go-git-clone
10:15:50.616532 upload_pack.go:41: performance: 0.234388589 s: upload_pack
Enumerating objects: 582, done.
Counting objects: 100% (582/582), done.
Compressing objects: 100% (531/531), done.
Total 582 (delta 31), reused 165 (delta 10), pack-reused 0 (from 0)
10:15:50.683061 common.go:32: performance: 0.066241589 s: update_obj_storage
10:15:50.811161 worktree.go:366: performance: 0.127937022 s: reset_worktree
10:15:50.811257 repository.go:489: performance: 0.597924171 s: git command: git clone https://github.com/go-git/go-git
commit 9973a38

GIT_TRACE_PERFORMANCE=true git clone --depth 1 --single-branch https://github.com/go-git/go-git /tmp/git-cli-clone
Cloning into '/tmp/git-cli-clone'...
remote: Enumerating objects: 582, done.
remote: Counting objects: 100% (582/582), done.
remote: Compressing objects: 100% (531/531), done.
remote: Total 582 (delta 31), reused 165 (delta 10), pack-reused 0 (from 0)
Receiving objects: 100% (582/582), 654.33 KiB | 6.00 MiB/s, done.
Resolving deltas: 100% (31/31), done.
10:23:04.662692 trace.c:416             performance: 0.205806146 s: git command: /usr/libexec/git/git --shallow-file /tmp/git-cli-clone/.git/shallow.lock index-pack --stdin -v --fix-thin '--keep=fetch-pack 122550 on localhost.localdomain'
10:23:04.662821 trace.c:416             performance: 0.607833632 s: git command: /usr/libexec/git/git remote-https origin https://github.com/go-git/go-git
10:23:04.664931 trace.c:416             performance: 0.000640393 s: git command: /usr/libexec/git/git rev-list --objects --stdin --not --all --quiet --alternate-refs '--progress=Checking connectivity'
10:23:04.667253 unpack-trees.c:2009     performance: 0.000710704 s:   traverse_trees
10:23:04.678219 unpack-trees.c:511      performance: 0.010950771 s:   check_updates
10:23:04.678465 cache-tree.c:491        performance: 0.000228486 s:   cache_tree_update
10:23:04.678472 unpack-trees.c:2106     performance: 0.011949092 s:  unpack_trees
10:23:04.678728 read-cache.c:3114       performance: 0.000251809 s:  write index, changed mask = 2a
10:23:04.678772 trace.c:416             performance: 0.628392351 s: git command: git clone --depth 1 --single-branch https://github.com/go-git/go-git /tmp/git-cli-clone

Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* previously an example existed for working with `config.Config`, but changes in implementation made the example not usable. (see go-git#75)
* this mostly puts back the original example with some modifications to
make it work with current implementation
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
@pjbgf pjbgf added this to the v6.0.0 milestone Dec 19, 2024
@pjbgf pjbgf merged commit 1872aa6 into go-git:v6-exp Dec 19, 2024
11 of 13 checks passed
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.

4 participants
0