From: Kjetil Barvik <barvik@broadpark.no>
To: git@vger.kernel.org
Cc: Kjetil Barvik <barvik@broadpark.no>
Subject: [PATCH/RFC v1 0/6] git checkout: more cleanups, optimisation, less lstat() calls
Date: Mon, 26 Jan 2009 22:17:11 +0100 [thread overview]
Message-ID: <1233004637-15112-1-git-send-email-barvik@broadpark.no> (raw)
Here is 6 small patches which should further improve the time it take
to do 'git checkout'. After the 6 patches, the numbers from the 'git
checkout -q my-v2.6.27' test, should now look like this:
TOTAL 136752 100.000% OK:124567 NOT: 12185 8.641698 sec 63 usec/call
lstat64 55502 40.586% OK: 49122 NOT: 6380 2.463762 sec 44 usec/call
strings 55502 tot 30163 uniq 1.840 /uniq 2.463762 sec 44 usec/call
files 47122 tot 23813 uniq 1.979 /uniq 2.070486 sec 44 usec/call
dirs 2000 tot 1436 uniq 1.393 /uniq 0.087281 sec 44 usec/call
errors 6380 tot 5187 uniq 1.230 /uniq 0.305995 sec 48 usec/call
4 0.007% OK: 3 NOT: 1 "arch/sh/boards"
3 0.005% OK: 3 NOT: 0 ".git/HEAD"
3 0.005% OK: 3 NOT: 0 ".git/refs/heads/my-v2.6.27"
3 0.005% OK: 3 NOT: 0 ".gitignore"
3 0.005% OK: 3 NOT: 0 ".mailmap"
3 0.005% OK: 3 NOT: 0 "CREDITS"
3 0.005% OK: 3 NOT: 0 "Documentation"
3 0.005% OK: 3 NOT: 0 "Documentation/00-INDEX"
3 0.005% OK: 3 NOT: 0 "Documentation/ABI/testing/sysfs-block"
3 0.005% OK: 3 NOT: 0 "Documentation/ABI/testing/sysfs-firmware-acpi"
3 0.005% OK: 3 NOT: 0 "Documentation/CodingStyle"
3 0.005% OK: 3 NOT: 0 "Documentation/DMA-API.txt"
3 0.005% OK: 3 NOT: 0 "Documentation/DMA-mapping.txt"
3 0.005% OK: 3 NOT: 0 "Documentation/DocBook/Makefile"
3 0.005% OK: 3 NOT: 0 "Documentation/DocBook/gadget.tmpl"
3 0.005% OK: 3 NOT: 0 "Documentation/DocBook/kernel-api.tmpl"
3 0.005% OK: 3 NOT: 0 "Documentation/DocBook/kernel-locking.tmpl"
3 0.005% OK: 3 NOT: 0 "Documentation/DocBook/procfs-guide.tmpl"
3 0.005% OK: 3 NOT: 0 "Documentation/DocBook/procfs_example.c"
3 0.005% OK: 3 NOT: 0 "Documentation/DocBook/rapidio.tmpl"
<snipp>
fstat64 14403 10.532% OK: 14403 NOT: 0 0.179938 sec 12 usec/call
So, since last time, and because of patch 4/6, almost 14 400 of the
lstat() calls has now become fstat() calls, and it seems we have saved
(* 14403 (- 44 12)) = 460 896 microseconds system time because of
this. I am planing to do a more complete and long-running
/usr/bin/time test, to get real numbers.
With both patch-series, the count of lstat() calls for this particular
test have dropped from 120 954 to 55 502, which is a total reduction
of 65 452 calls or 54%.
Please note that patch 6/6 is only to be a debug patch, to catch a
possible ping-pong situation inside the lstat_cache(), so I think that
it should at _most_ be merged to the pu branch, such that people who
wish to test, can 'git cherry-pick' the patch from there.
Kjetil Barvik (6):
symlinks.c: small cleanup and optimisation
remove some memcpy() and strchr() calls inside create_directories()
cleanup of write_entry() in entry.c
use fstat() instead of lstat() when we have an opened file
combine-diff.c: remove a call to fstat() inside show_patch_diff()
lstat_cache(): print a warning if doing ping-pong between cache types
combine-diff.c | 5 +-
entry.c | 144 ++++++++++++++++++++++++++++++--------------------------
symlinks.c | 48 ++++++++++++++-----
3 files changed, 115 insertions(+), 82 deletions(-)
next reply other threads:[~2009-01-26 21:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-26 21:17 Kjetil Barvik [this message]
2009-01-26 21:17 ` [PATCH/RFC v1 1/6] symlinks.c: small cleanup and optimisation Kjetil Barvik
2009-01-28 20:36 ` ??? " Junio C Hamano
2009-01-29 14:19 ` Kjetil Barvik
2009-01-26 21:17 ` [PATCH/RFC v1 2/6] remove some memcpy() and strchr() calls inside create_directories() Kjetil Barvik
2009-01-28 20:36 ` Junio C Hamano
2009-01-26 21:17 ` [PATCH/RFC v1 3/6] cleanup of write_entry() in entry.c Kjetil Barvik
2009-01-28 21:31 ` Junio C Hamano
2009-01-26 21:17 ` [PATCH/RFC v1 4/6] use fstat() instead of lstat() when we have an opened file Kjetil Barvik
2009-01-26 21:17 ` [PATCH/RFC v1 5/6] combine-diff.c: remove a call to fstat() inside show_patch_diff() Kjetil Barvik
2009-01-27 9:35 ` Mike Ralphson
2009-01-27 12:03 ` Kjetil Barvik
2009-01-27 12:06 ` Mike Ralphson
2009-01-28 20:37 ` Junio C Hamano
2009-01-29 1:16 ` Junio C Hamano
2009-01-29 8:20 ` Kjetil Barvik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1233004637-15112-1-git-send-email-barvik@broadpark.no \
--to=barvik@broadpark.no \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).