Re: Add specialized object allocator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Mon, 19 Jun 2006, Linus Torvalds wrote:
> 
> It also allows us to track some basic statistics about object
> allocations. For example, for the mozilla import, it shows
> object usage as follows:
> 
>      blobs:   627629 (14710 kB)
>      trees:  1119035 (34969 kB)
>    commits:   196423  (8440 kB)
>       tags:     1336    (46 kB)

Btw, this is the trivial additional patch to allow you to say

	git --report rev-list --all --objects > /dev/null

and have it report object allocation usage after the op.

Useful? Probably not. It was useful for me to verify that everything 
looked ok (and while I knew we had more trees than blobs, it's actually 
interesting to see how projects differ.

The "git" tree, for example, has more blobs than trees: because it's a 
fairly flat development tree, a commit that changes more than one file 
will generate more new blobs than it generates trees.

In contrast, the kernel has about 30% more trees than blobs (but since 
trees have the extra data/size fields, 30% extra trees take 75% more space 
than blobs).

The mozilla import has a _lot_ more trees than blobs (80% more trees, and 
they use up more than twice as much memory). It's probably a pretty deep 
tree structure and/or they often commit changes to single files deep into 
the tree).

		Linus

----
diff --git a/git.c b/git.c
index 329ebec..6149499 100644
--- a/git.c
+++ b/git.c
@@ -271,6 +271,10 @@ int main(int argc, const char **argv, ch
 			puts(git_exec_path());
 			exit(0);
 		}
+		if (!strcmp(cmd, "report")) {
+			atexit(alloc_report);
+			continue;
+		}
 		cmd_usage(0, NULL, NULL);
 	}
 	argv[0] = cmd;
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]