The hunt continues.. (and thanks everyone for suggestions). Now
is_excluded() (and exclude machinery) is no longer the hot spot in
read_directory. index_name_exists is the new star:

function                  time (in seconds)
treat_leading_path:       0.000
read_directory:           0.289
+treat_one_path:          0.147
++is_excluded:            0.013
+++prep_exclude:          0.006
+++matching:              0.004
++dir_exists_in_index:    0.008
++index_name_exists:      0.117 <--
+++lazy_init_name_hash:   0.060
+simplify_away:           0.004
+dir_add_name:            0.000

real    0m0.372s
user    0m0.256s
sys     0m0.114s  <-- can't kill this one (*) until we get inotify support

I think if we save the hash in index, we could nearly cut
lazy_init_name_hash out (or not, perf reported insert_hash near the
top, not hash_name). Any ideas to further reduce iname_name_exists
cost are welcome. 0.117s on 2.50GHz turns to 0.549s on my Atom 1.6GHz,
so I think it's worth doing something about it.

(*) I tried breadth-first search, checking for .gitignore existence
before opening, chdir() to shorten pathnames. Nothing worked.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to