Merge branch 'jk/mark-edges-uninteresting'

Fix performance regression in v1.8.4.x and later.

* jk/mark-edges-uninteresting:
  list-objects: only look at cmdline trees with edge_hint
  t/perf: time rev-list with UNINTERESTING commits
This commit is contained in:
Junio C Hamano 2014-01-27 10:45:08 -08:00
Родитель e049109ef1 200abe7458
Коммит a6bec00145
2 изменённых файлов: 23 добавлений и 9 удалений

Просмотреть файл

@ -162,15 +162,17 @@ void mark_edges_uninteresting(struct rev_info *revs, show_edge_fn show_edge)
}
mark_edge_parents_uninteresting(commit, revs, show_edge);
}
for (i = 0; i < revs->cmdline.nr; i++) {
struct object *obj = revs->cmdline.rev[i].item;
struct commit *commit = (struct commit *)obj;
if (obj->type != OBJ_COMMIT || !(obj->flags & UNINTERESTING))
continue;
mark_tree_uninteresting(commit->tree);
if (revs->edge_hint && !(obj->flags & SHOWN)) {
obj->flags |= SHOWN;
show_edge(commit);
if (revs->edge_hint) {
for (i = 0; i < revs->cmdline.nr; i++) {
struct object *obj = revs->cmdline.rev[i].item;
struct commit *commit = (struct commit *)obj;
if (obj->type != OBJ_COMMIT || !(obj->flags & UNINTERESTING))
continue;
mark_tree_uninteresting(commit->tree);
if (!(obj->flags & SHOWN)) {
obj->flags |= SHOWN;
show_edge(commit);
}
}
}
}

Просмотреть файл

@ -14,4 +14,16 @@ test_perf 'rev-list --all --objects' '
git rev-list --all --objects >/dev/null
'
test_expect_success 'create new unreferenced commit' '
commit=$(git commit-tree HEAD^{tree} -p HEAD)
'
test_perf 'rev-list $commit --not --all' '
git rev-list $commit --not --all >/dev/null
'
test_perf 'rev-list --objects $commit --not --all' '
git rev-list --objects $commit --not --all >/dev/null
'
test_done