mirror of
https://github.com/git/git.git
synced 2024-11-15 05:33:04 +01:00
9e5972413b
Overall time saving on "git status" is about 40% in the best case scenario, removing ..collect_untracked() as the most time consuming function. read and refresh index operations are now at the top (which should drop when index-helper and/or watchman support is added). More numbers and analysis below. webkit.git ========== 169k files. 6k dirs. Lots of test data (i.e. not touched most of the time) Base status ----------- Index version 4 in split index mode and cache-tree populated. No untracked cache. It shows how time is consumed by "git status". The same settings are used for other repos below. 18:28:10.199679 builtin/commit.c:1394 performance: 0.000000451 s: cmd_status:setup 18:28:10.474847 read-cache.c:1407 performance: 0.274873831 s: read_index 18:28:10.475295 read-cache.c:1407 performance: 0.000000656 s: read_index 18:28:10.728443 preload-index.c:131 performance: 0.253147487 s: read_index_preload 18:28:10.741422 read-cache.c:1254 performance: 0.012868340 s: refresh_index 18:28:10.752300 wt-status.c:623 performance: 0.010421357 s: wt_status_collect_changes_worktree 18:28:10.762069 wt-status.c:629 performance: 0.009644748 s: wt_status_collect_changes_index 18:28:11.601019 wt-status.c:632 performance: 0.838859547 s: wt_status_collect_untracked 18:28:11.605939 builtin/commit.c:1421 performance: 0.004835004 s: cmd_status:update_index 18:28:11.606580 trace.c:415 performance: 1.407878388 s: git command: 'git' 'status' Populating status ----------------- This is after enabling untracked cache and the cache is still empty. We see a slight increase in .._collect_untracked() and update_index (because new cache has to be written to $GIT_DIR/index). 18:28:18.915213 builtin/commit.c:1394 performance: 0.000000326 s: cmd_status:setup 18:28:19.197364 read-cache.c:1407 performance: 0.281901416 s: read_index 18:28:19.197754 read-cache.c:1407 performance: 0.000000546 s: read_index 18:28:19.451355 preload-index.c:131 performance: 0.253599607 s: read_index_preload 18:28:19.464400 read-cache.c:1254 performance: 0.012935336 s: refresh_index 18:28:19.475115 wt-status.c:623 performance: 0.010236920 s: wt_status_collect_changes_worktree 18:28:19.486022 wt-status.c:629 performance: 0.010801685 s: wt_status_collect_changes_index 18:28:20.362660 wt-status.c:632 performance: 0.876551366 s: wt_status_collect_untracked 18:28:20.396199 builtin/commit.c:1421 performance: 0.033447969 s: cmd_status:update_index 18:28:20.396939 trace.c:415 performance: 1.482695902 s: git command: 'git' 'status' Populated status ---------------- After the cache is populated, wt_status_collect_untracked() drops 82% from 0.838s to 0.144s. Overall time drops 45%. Top offenders are now read_index() and read_index_preload(). 18:28:20.408605 builtin/commit.c:1394 performance: 0.000000457 s: cmd_status:setup 18:28:20.692864 read-cache.c:1407 performance: 0.283980458 s: read_index 18:28:20.693273 read-cache.c:1407 performance: 0.000000661 s: read_index 18:28:20.958814 preload-index.c:131 performance: 0.265540254 s: read_index_preload 18:28:20.972375 read-cache.c:1254 performance: 0.013437429 s: refresh_index 18:28:20.983959 wt-status.c:623 performance: 0.011146646 s: wt_status_collect_changes_worktree 18:28:20.993948 wt-status.c:629 performance: 0.009879094 s: wt_status_collect_changes_index 18:28:21.138125 wt-status.c:632 performance: 0.144084737 s: wt_status_collect_untracked 18:28:21.173678 builtin/commit.c:1421 performance: 0.035463949 s: cmd_status:update_index 18:28:21.174251 trace.c:415 performance: 0.766707355 s: git command: 'git' 'status' gentoo-x86.git ============== This repository is a strange one with a balanced, wide and shallow worktree (about 100k files and 23k dirs) and no .gitignore in worktree. .._collect_untracked() time drops 88%, total time drops 56%. Base status ----------- 18:20:40.828642 builtin/commit.c:1394 performance: 0.000000496 s: cmd_status:setup 18:20:41.027233 read-cache.c:1407 performance: 0.198130532 s: read_index 18:20:41.027670 read-cache.c:1407 performance: 0.000000581 s: read_index 18:20:41.171716 preload-index.c:131 performance: 0.144045594 s: read_index_preload 18:20:41.179171 read-cache.c:1254 performance: 0.007320424 s: refresh_index 18:20:41.185785 wt-status.c:623 performance: 0.006144638 s: wt_status_collect_changes_worktree 18:20:41.192701 wt-status.c:629 performance: 0.006780184 s: wt_status_collect_changes_index 18:20:41.991723 wt-status.c:632 performance: 0.798927029 s: wt_status_collect_untracked 18:20:41.994664 builtin/commit.c:1421 performance: 0.002852772 s: cmd_status:update_index 18:20:41.995458 trace.c:415 performance: 1.168427502 s: git command: 'git' 'status' Populating status ----------------- 18:20:48.968848 builtin/commit.c:1394 performance: 0.000000380 s: cmd_status:setup 18:20:49.172918 read-cache.c:1407 performance: 0.203734214 s: read_index 18:20:49.173341 read-cache.c:1407 performance: 0.000000562 s: read_index 18:20:49.320013 preload-index.c:131 performance: 0.146671391 s: read_index_preload 18:20:49.328039 read-cache.c:1254 performance: 0.007921957 s: refresh_index 18:20:49.334680 wt-status.c:623 performance: 0.006172020 s: wt_status_collect_changes_worktree 18:20:49.342526 wt-status.c:629 performance: 0.007731746 s: wt_status_collect_changes_index 18:20:50.257510 wt-status.c:632 performance: 0.914864222 s: wt_status_collect_untracked 18:20:50.338371 builtin/commit.c:1421 performance: 0.080776477 s: cmd_status:update_index 18:20:50.338900 trace.c:415 performance: 1.371462446 s: git command: 'git' 'status' Populated status ---------------- 18:20:50.351160 builtin/commit.c:1394 performance: 0.000000571 s: cmd_status:setup 18:20:50.577358 read-cache.c:1407 performance: 0.225917338 s: read_index 18:20:50.577794 read-cache.c:1407 performance: 0.000000617 s: read_index 18:20:50.734140 preload-index.c:131 performance: 0.156345564 s: read_index_preload 18:20:50.745717 read-cache.c:1254 performance: 0.011463075 s: refresh_index 18:20:50.755176 wt-status.c:623 performance: 0.008877929 s: wt_status_collect_changes_worktree 18:20:50.763768 wt-status.c:629 performance: 0.008471633 s: wt_status_collect_changes_index 18:20:50.854885 wt-status.c:632 performance: 0.090988721 s: wt_status_collect_untracked 18:20:50.857765 builtin/commit.c:1421 performance: 0.002789097 s: cmd_status:update_index 18:20:50.858411 trace.c:415 performance: 0.508647673 s: git command: 'git' 'status' linux-2.6 ========= Reference repo. Not too big. .._collect_status() drops 84%. Total time drops 42%. Base status ----------- 18:34:09.870122 builtin/commit.c:1394 performance: 0.000000385 s: cmd_status:setup 18:34:09.943218 read-cache.c:1407 performance: 0.072871177 s: read_index 18:34:09.943614 read-cache.c:1407 performance: 0.000000491 s: read_index 18:34:10.004364 preload-index.c:131 performance: 0.060748102 s: read_index_preload 18:34:10.008190 read-cache.c:1254 performance: 0.003714285 s: refresh_index 18:34:10.012087 wt-status.c:623 performance: 0.002775446 s: wt_status_collect_changes_worktree 18:34:10.016054 wt-status.c:629 performance: 0.003862140 s: wt_status_collect_changes_index 18:34:10.214747 wt-status.c:632 performance: 0.198604837 s: wt_status_collect_untracked 18:34:10.216102 builtin/commit.c:1421 performance: 0.001244166 s: cmd_status:update_index 18:34:10.216817 trace.c:415 performance: 0.347670735 s: git command: 'git' 'status' Populating status ----------------- 18:34:16.595102 builtin/commit.c:1394 performance: 0.000000456 s: cmd_status:setup 18:34:16.666600 read-cache.c:1407 performance: 0.070992413 s: read_index 18:34:16.667012 read-cache.c:1407 performance: 0.000000606 s: read_index 18:34:16.729375 preload-index.c:131 performance: 0.062362492 s: read_index_preload 18:34:16.732565 read-cache.c:1254 performance: 0.003075517 s: refresh_index 18:34:16.736148 wt-status.c:623 performance: 0.002422201 s: wt_status_collect_changes_worktree 18:34:16.739990 wt-status.c:629 performance: 0.003746618 s: wt_status_collect_changes_index 18:34:16.948505 wt-status.c:632 performance: 0.208426710 s: wt_status_collect_untracked 18:34:16.961744 builtin/commit.c:1421 performance: 0.013151887 s: cmd_status:update_index 18:34:16.962233 trace.c:415 performance: 0.368537535 s: git command: 'git' 'status' Populated status ---------------- 18:34:16.970026 builtin/commit.c:1394 performance: 0.000000631 s: cmd_status:setup 18:34:17.046235 read-cache.c:1407 performance: 0.075904673 s: read_index 18:34:17.046644 read-cache.c:1407 performance: 0.000000681 s: read_index 18:34:17.113564 preload-index.c:131 performance: 0.066920253 s: read_index_preload 18:34:17.117281 read-cache.c:1254 performance: 0.003604055 s: refresh_index 18:34:17.121115 wt-status.c:623 performance: 0.002508345 s: wt_status_collect_changes_worktree 18:34:17.125089 wt-status.c:629 performance: 0.003871636 s: wt_status_collect_changes_index 18:34:17.156089 wt-status.c:632 performance: 0.030895703 s: wt_status_collect_untracked 18:34:17.169861 builtin/commit.c:1421 performance: 0.013686404 s: cmd_status:update_index 18:34:17.170391 trace.c:415 performance: 0.201474531 s: git command: 'git' 'status' Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
.. | ||
howto | ||
RelNotes | ||
technical | ||
.gitattributes | ||
.gitignore | ||
asciidoc.conf | ||
blame-options.txt | ||
build-docdep.perl | ||
cat-texi.perl | ||
cmd-list.perl | ||
CodingGuidelines | ||
config.txt | ||
date-formats.txt | ||
diff-config.txt | ||
diff-format.txt | ||
diff-generate-patch.txt | ||
diff-options.txt | ||
docbook-xsl.css | ||
docbook.xsl | ||
everyday.txto | ||
fetch-options.txt | ||
fix-texi.perl | ||
git-add.txt | ||
git-am.txt | ||
git-annotate.txt | ||
git-apply.txt | ||
git-archimport.txt | ||
git-archive.txt | ||
git-bisect-lk2009.txt | ||
git-bisect.txt | ||
git-blame.txt | ||
git-branch.txt | ||
git-bundle.txt | ||
git-cat-file.txt | ||
git-check-attr.txt | ||
git-check-ignore.txt | ||
git-check-mailmap.txt | ||
git-check-ref-format.txt | ||
git-checkout-index.txt | ||
git-checkout.txt | ||
git-cherry-pick.txt | ||
git-cherry.txt | ||
git-citool.txt | ||
git-clean.txt | ||
git-clone.txt | ||
git-column.txt | ||
git-commit-tree.txt | ||
git-commit.txt | ||
git-config.txt | ||
git-count-objects.txt | ||
git-credential-cache--daemon.txt | ||
git-credential-cache.txt | ||
git-credential-store.txt | ||
git-credential.txt | ||
git-cvsexportcommit.txt | ||
git-cvsimport.txt | ||
git-cvsserver.txt | ||
git-daemon.txt | ||
git-describe.txt | ||
git-diff-files.txt | ||
git-diff-index.txt | ||
git-diff-tree.txt | ||
git-diff.txt | ||
git-difftool.txt | ||
git-fast-export.txt | ||
git-fast-import.txt | ||
git-fetch-pack.txt | ||
git-fetch.txt | ||
git-filter-branch.txt | ||
git-fmt-merge-msg.txt | ||
git-for-each-ref.txt | ||
git-format-patch.txt | ||
git-fsck-objects.txt | ||
git-fsck.txt | ||
git-gc.txt | ||
git-get-tar-commit-id.txt | ||
git-grep.txt | ||
git-gui.txt | ||
git-hash-object.txt | ||
git-help.txt | ||
git-http-backend.txt | ||
git-http-fetch.txt | ||
git-http-push.txt | ||
git-imap-send.txt | ||
git-index-pack.txt | ||
git-init-db.txt | ||
git-init.txt | ||
git-instaweb.txt | ||
git-interpret-trailers.txt | ||
git-log.txt | ||
git-ls-files.txt | ||
git-ls-remote.txt | ||
git-ls-tree.txt | ||
git-mailinfo.txt | ||
git-mailsplit.txt | ||
git-merge-base.txt | ||
git-merge-file.txt | ||
git-merge-index.txt | ||
git-merge-one-file.txt | ||
git-merge-tree.txt | ||
git-merge.txt | ||
git-mergetool--lib.txt | ||
git-mergetool.txt | ||
git-mktag.txt | ||
git-mktree.txt | ||
git-mv.txt | ||
git-name-rev.txt | ||
git-notes.txt | ||
git-p4.txt | ||
git-pack-objects.txt | ||
git-pack-redundant.txt | ||
git-pack-refs.txt | ||
git-parse-remote.txt | ||
git-patch-id.txt | ||
git-prune-packed.txt | ||
git-prune.txt | ||
git-pull.txt | ||
git-push.txt | ||
git-quiltimport.txt | ||
git-read-tree.txt | ||
git-rebase.txt | ||
git-receive-pack.txt | ||
git-reflog.txt | ||
git-relink.txt | ||
git-remote-ext.txt | ||
git-remote-fd.txt | ||
git-remote-helpers.txto | ||
git-remote-testgit.txt | ||
git-remote.txt | ||
git-repack.txt | ||
git-replace.txt | ||
git-request-pull.txt | ||
git-rerere.txt | ||
git-reset.txt | ||
git-rev-list.txt | ||
git-rev-parse.txt | ||
git-revert.txt | ||
git-rm.txt | ||
git-send-email.txt | ||
git-send-pack.txt | ||
git-sh-i18n--envsubst.txt | ||
git-sh-i18n.txt | ||
git-sh-setup.txt | ||
git-shell.txt | ||
git-shortlog.txt | ||
git-show-branch.txt | ||
git-show-index.txt | ||
git-show-ref.txt | ||
git-show.txt | ||
git-stage.txt | ||
git-stash.txt | ||
git-status.txt | ||
git-stripspace.txt | ||
git-submodule.txt | ||
git-svn.txt | ||
git-symbolic-ref.txt | ||
git-tag.txt | ||
git-tools.txt | ||
git-unpack-file.txt | ||
git-unpack-objects.txt | ||
git-update-index.txt | ||
git-update-ref.txt | ||
git-update-server-info.txt | ||
git-upload-archive.txt | ||
git-upload-pack.txt | ||
git-var.txt | ||
git-verify-commit.txt | ||
git-verify-pack.txt | ||
git-verify-tag.txt | ||
git-web--browse.txt | ||
git-whatchanged.txt | ||
git-write-tree.txt | ||
git.txt | ||
gitattributes.txt | ||
gitcli.txt | ||
gitcore-tutorial.txt | ||
gitcredentials.txt | ||
gitcvs-migration.txt | ||
gitdiffcore.txt | ||
giteveryday.txt | ||
gitglossary.txt | ||
githooks.txt | ||
gitignore.txt | ||
gitk.txt | ||
gitmodules.txt | ||
gitnamespaces.txt | ||
gitremote-helpers.txt | ||
gitrepository-layout.txt | ||
gitrevisions.txt | ||
gittutorial-2.txt | ||
gittutorial.txt | ||
gitweb.conf.txt | ||
gitweb.txt | ||
gitworkflows.txt | ||
glossary-content.txt | ||
howto-index.sh | ||
i18n.txt | ||
install-doc-quick.sh | ||
install-webdoc.sh | ||
line-range-format.txt | ||
mailmap.txt | ||
Makefile | ||
manpage-1.72.xsl | ||
manpage-base-url.xsl.in | ||
manpage-base.xsl | ||
manpage-bold-literal.xsl | ||
manpage-normal.xsl | ||
manpage-quote-apos.xsl | ||
manpage-suppress-sp.xsl | ||
merge-config.txt | ||
merge-options.txt | ||
merge-strategies.txt | ||
pretty-formats.txt | ||
pretty-options.txt | ||
pull-fetch-param.txt | ||
rev-list-options.txt | ||
revisions.txt | ||
sequencer.txt | ||
SubmittingPatches | ||
urls-remotes.txt | ||
urls.txt | ||
user-manual.conf | ||
user-manual.txt |