aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-08-23 04:31:12 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-01-14 02:15:05 -0500
commitd6c7eb2c160fc40c48fd25fdae15c193eec13bb7 (patch)
tree1de4b8993b7f656b68626b5d19d3501b75046647
parentd83971688ba42e4cd37908f4d776801a997ca421 (diff)
downloadgit-d6c7eb2c160fc40c48fd25fdae15c193eec13bb7.tar.gz
git-d6c7eb2c160fc40c48fd25fdae15c193eec13bb7.tar.xz
Added branch load counter to fast-import.
If the branch load count exceeds the number of branches created then the frontend is causing fast-import to page branches into and out of memory due to the way its ordering its commits. Performance can likely be increased if the frontend were to alter its commit sequence such that it stays on one branch before switching to another branch, then never returns to the prior branch. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--fast-import.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c
index 6e2f106a1..50171d69c 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -190,6 +190,7 @@ struct branch
static unsigned long max_depth = 10;
static unsigned long alloc_count;
static unsigned long branch_count;
+static unsigned long branch_load_count;
static unsigned long object_count;
static unsigned long duplicate_count;
static unsigned long marks_set_count;
@@ -1059,6 +1060,7 @@ static void load_branch(struct branch *b)
b->active_next_branch = active_branches;
active_branches = b;
cur_active_branches++;
+ branch_load_count++;
}
static void file_change_m(struct branch *b)
@@ -1382,9 +1384,9 @@ int main(int argc, const char **argv)
fprintf(stderr, " trees : %10lu (%10lu duplicates)\n", object_count_by_type[OBJ_TREE], duplicate_count_by_type[OBJ_TREE]);
fprintf(stderr, " commits: %10lu (%10lu duplicates)\n", object_count_by_type[OBJ_COMMIT], duplicate_count_by_type[OBJ_COMMIT]);
fprintf(stderr, " tags : %10lu (%10lu duplicates)\n", object_count_by_type[OBJ_TAG], duplicate_count_by_type[OBJ_TAG]);
- fprintf(stderr, "Total branches: %10lu\n", branch_count);
- fprintf(stderr, " atoms: %10u\n", atom_cnt);
+ fprintf(stderr, "Total branches: %10lu (%10lu loads )\n", branch_count, branch_load_count);
fprintf(stderr, " marks: %10u (%10lu unique )\n", (1 << marks->shift) * 1024, marks_set_count);
+ fprintf(stderr, " atoms: %10u\n", atom_cnt);
fprintf(stderr, "Memory total: %10lu KiB\n", (total_allocd + alloc_count*sizeof(struct object_entry))/1024);
fprintf(stderr, " pools: %10lu KiB\n", total_allocd/1024);
fprintf(stderr, " objects: %10lu KiB\n", (alloc_count*sizeof(struct object_entry))/1024);