[PATCH/RFC v2 0/7] git checkout: more cleanups, optimisation, less lstat() calls
- From
- Kjetil Barvik <barvik@broadpark.no>
- Date
- Feb 1, 2009, 20:23 UTC
- Message-ID
- <cover.1233499703.git.barvik@broadpark.no>
Changes since v1
--- patch 1/7 --- Kept the "match_len >= cache.len" trick only inside the longest_match_lstat_cache() function. Also removed the arguments to reset_lstat_cache()
--- patch 2/7 --- Applied all comments from Junio
--- patch 3/7 --- Kept long format strings in printf() calls, even if source lines get longer than 80 chars. The patch touch less source lines because of this.
--- patch 4/7 --- Added sanity check to the if-test under which fstat() is called.
--- patch 5/7 --- Updated commit log message
--- patch 7/7 --- New patch which reduces the number of rmdir() calls significantly. When tested with 'git chekcout -q my-v2.6.27' (checkout from Linux v2.6.25 to v2.6.27), the numbers look like this before this patch:
rmdir 4532 3.314% OK: 174 NOT: 4358 0.263268 sec 58 usec/call
strings 4532 tot 354 uniq 12.802 /uniq 0.263268 sec 58 usec/call
errors 4358 tot 347 uniq 12.559 /uniq 0.249116 sec 57 usec/call
233 5.141% OK: 1 NOT: 232 "include/asm-powerpc"
187 4.126% OK: 1 NOT: 186 "include/asm-sh"
172 3.795% OK: 0 NOT: 172 "include/asm-arm"
169 3.729% OK: 1 NOT: 168 "include/asm-sparc64"
161 3.553% OK: 1 NOT: 160 "include/asm-sparc"
144 3.177% OK: 1 NOT: 143 "include/asm-ia64"
143 3.155% OK: 1 NOT: 142 "include/asm-m68knommu"
133 2.935% OK: 1 NOT: 132 "include/asm-alpha"
126 2.780% OK: 1 NOT: 125 "include/asm-s390"
122 2.692% OK: 1 NOT: 121 "include/asm-v850"Notice the nice change in the top 10 list after this patch:
rmdir 331 0.255% OK: 174 NOT: 157 0.033435 sec 101 usec/call
strings 331 tot 331 uniq 1.000 /uniq 0.033435 sec 101 usec/call
errors 157 tot 157 uniq 1.000 /uniq 0.016300 sec 104 usec/call
1 0.302% OK: 0 NOT: 1 "Documentation"
1 0.302% OK: 0 NOT: 1 "Documentation/filesystems/configfs"
1 0.302% OK: 0 NOT: 1 "Documentation/firmware_class"
1 0.302% OK: 1 NOT: 0 "Documentation/hrtimer"
1 0.302% OK: 1 NOT: 0 "Documentation/hrtimers"
1 0.302% OK: 0 NOT: 1 "Documentation/i2c/busses"
1 0.302% OK: 1 NOT: 0 "Documentation/i386"
1 0.302% OK: 0 NOT: 1 "Documentation/networking"
1 0.302% OK: 0 NOT: 1 "Documentation/power"
1 0.302% OK: 0 NOT: 1 "Documentation/powerpc"Kjetil Barvik (7): symlinks.c: small cleanup and optimisation remove some memcpy() and strchr() calls inside create_directories() cleanup of write_entry() in entry.c write_entry(): use fstat() instead of lstat() when file is open combine-diff.c: remove a call to fstat() inside show_patch_diff() lstat_cache(): print a warning if doing ping-pong between cache types unpack-trees.c: introduce schedule_dir_for_removal()
combine-diff.c | 4 +-- entry.c | 106 +++++++++++++++++++++++++++----------------------------- symlinks.c | 67 +++++++++++++++++++++++++---------- unpack-trees.c | 97 ++++++++++++++++++++++++++++++++++++++------------- 4 files changed, 172 insertions(+), 102 deletions(-)