{"thread":{"id":"30851","subject":"how to benchmark git commands","startedAt":"2012-06-20T19:28:28Z","lastAt":"2012-06-21T07:28:40Z","messageCount":2,"participants":["Neal Kreitzinger","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193970","messageId":"jrt88s$h70$1@dough.gmane.org","threadId":"30851","inReplyTo":null,"subject":"how to benchmark git commands","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-06-20T19:28:28Z","receivedAt":"2012-06-20T19:28:28Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"I want to benchmark how long it takes commands like git-gc, git-fsck, \netc. to run against our canonical repo.  What is the correct way to do \nthis?  I am being asked how much time such commands would add to \nautomated on-demand push scripts.\n\nv/r,\nneal\n"},{"id":"194031","messageId":"87k3z1rumv.fsf@thomas.inf.ethz.ch","threadId":"30851","inReplyTo":"jrt88s$h70$1@dough.gmane.org","subject":"Re: how to benchmark git commands","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2012-06-21T07:28:40Z","receivedAt":"2012-06-21T07:28:40Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Neal Kreitzinger <nkreitzinger@gmail.com> writes:\n\n> I want to benchmark how long it takes commands like git-gc, git-fsck,\n> etc. to run against our canonical repo.  What is the correct way to do\n> this?  I am being asked how much time such commands would add to\n> automated on-demand push scripts.\n\nUmm, what's wrong with\n\n$ time git fsck\n\nThe bigger question is: do you want to measure hot or cold performance?\nFor most operations it is more useful to measure the hot performance, as\nthe repo will be hot anyway.  But in the fsck case I wouldn't be so\nsure; it's entirely possible that it \"usually\" faults a bunch of loose\nobjects that were otherwise unused, taking some extra time.  So there\nmay be some value in first running (as root)\n\n$ echo 3 >/proc/sys/vm/drop_caches\n\nto get cold-cache measurements.\n\nBesides, if you feel like properly evaluating performance in your\nrepository, you can look in t/perf/README.  Then point GIT_PERF_REPO at\nyour repo of choice, and write tests as needed (for example, there is\ncurrently no perf test for fsck).\n\nThat said, both gc and fsck are so slow on even medium-size repositories\n(like git.git) that you should probably put them in a nightly cronjob\ninstead.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}