1. 09 3月, 2013 2 次提交
  2. 25 5月, 2012 1 次提交
    • M
      Avoid sorting if references are added to ref_cache in order · 654ad400
      Michael Haggerty 提交于
      The old code allowed many references to be efficiently added to a
      single directory, because it just appended the references to the
      containing directory unsorted without doing any searching (and
      therefore without requiring any intermediate sorting).  But the old
      code was inefficient when a large number of subdirectories were added
      to a directory, because the directory always had to be searched to see
      if the new subdirectory already existed, and this search required the
      directory to be sorted first.  The same was repeated for every new
      subdirectory, so the time scaled like O(N^2), where N is the number of
      subdirectories within a single directory.
      
      In practice, references are often added to the ref_cache in
      lexicographic order, for example when reading the packed-refs file.
      So build some intelligence into add_entry_to_dir() to optimize for the
      case of references and/or subdirectories being added in lexicographic
      order: if the existing entries were already sorted, and the new entry
      comes after the last existing entry, then adjust ref_dir::sorted to
      reflect the fact that the ref_dir is still sorted.
      
      Thanks to Peff for pointing out the performance regression that
      inspired this change.
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      654ad400
  3. 23 5月, 2012 4 次提交
  4. 21 5月, 2012 1 次提交
  5. 05 5月, 2012 1 次提交
    • J
      refs: fix find_containing_dir() regression · 663c1295
      Junio C Hamano 提交于
      The function used to return NULL when asked to find the containing
      directory for a ref that does not exist, allowing the caller to
      omit iteration altogether. But a misconversion in an earlier change
      "refs.c: extract function search_for_subdir()" started returning the
      top-level directory entry, forcing callers to walk everything.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      663c1295
  6. 04 5月, 2012 15 次提交
  7. 26 4月, 2012 1 次提交
  8. 25 4月, 2012 1 次提交
  9. 11 4月, 2012 13 次提交
  10. 13 2月, 2012 1 次提交