aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2016-05-02 11:32:09 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2016-05-02 20:59:21 +0000
commitb7f20f28bc89a6599ce258f2705ac8e1351ab28d (patch)
tree58ce1e7d23d39df67216452b4d027f811b5a3d26
parent77ae237af753cd4f4820e67cdf058aea410bccc7 (diff)
downloadgo-x-review-b7f20f28bc89a6599ce258f2705ac8e1351ab28d.tar.xz
git-codereview: limit reviewer search to last 1000 commits
The vast majority of reviewers are consistently active, so limiting the search to the last 1000 commits won't lose many folks. And not loading every commit for a git mail helps with speed and avoids thrashing the disk cache, which is a pain point on my slow, spinning platter. Before, with a warm cache: $ time git log --format=format:%B | wc -l 301515 real 0m0.860s user 0m0.398s sys 0m0.164s After, with a warm cache: $ time git log --format=format:%B -n 1000 | wc -l 16765 real 0m0.036s user 0m0.021s sys 0m0.021s Change-Id: Ia56245e6ea05e4ce844d57a6ee96d19453192967 Reviewed-on: https://go-review.googlesource.com/22707 Reviewed-by: Andrew Gerrand <adg@golang.org>
-rw-r--r--git-codereview/mail.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-codereview/mail.go b/git-codereview/mail.go
index 4607bc1..4c40968 100644
--- a/git-codereview/mail.go
+++ b/git-codereview/mail.go
@@ -193,7 +193,7 @@ func loadReviewers() {
return
}
countByAddr := map[string]int{}
- for _, line := range nonBlankLines(cmdOutput("git", "log", "--format=format:%B")) {
+ for _, line := range nonBlankLines(cmdOutput("git", "log", "--format=format:%B", "-n", "1000")) {
if strings.HasPrefix(line, "Reviewed-by:") {
f := strings.Fields(line)
addr := f[len(f)-1]