diff options
author | Karsten Blees <karsten.blees@gmail.com> | 2013-04-15 21:13:35 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-15 12:34:01 -0700 |
commit | 8aaf8d7728e8ac50cbf6bcad05b6e896d4e69e0b (patch) | |
tree | 2d5e859c61225f786a0b49432ac97127dde5dd2b /t/t7505-prepare-commit-msg-hook.sh | |
parent | dir.c: replace is_path_excluded with now equivalent is_excluded API (diff) | |
download | tgif-8aaf8d7728e8ac50cbf6bcad05b6e896d4e69e0b.tar.xz |
dir.c: git-status: avoid is_excluded checks for tracked files
Checking if a file is in the index is much faster (hashtable lookup) than
checking if the file is excluded (linear search over exclude patterns).
Skip is_excluded checks for files: move the cache_name_exists check from
treat_file to treat_one_path and return early if the file is tracked.
This can safely be done as all other code paths also return path_ignored
for tracked files, and dir_add_ignored skips tracked files as well.
There's just one line left in treat_file, so move this to treat_one_path
as well.
Here's some performance data for git-status from the linux and WebKit
repos (best of 10 runs on a Debian Linux on SSD, core.preloadIndex=true):
| status | status --ignored
| linux | WebKit | linux | WebKit
-------+-------+--------+-------+---------
before | 0.218 | 1.583 | 0.321 | 2.579
after | 0.156 | 0.988 | 0.202 | 1.279
gain | 1.397 | 1.602 | 1.589 | 2.016
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7505-prepare-commit-msg-hook.sh')
0 files changed, 0 insertions, 0 deletions