From owner-freebsd-git@freebsd.org Tue May 28 13:43:00 2019 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4487815981DF for ; Tue, 28 May 2019 13:43:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F84E816BD for ; Tue, 28 May 2019 13:42:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f176.google.com with SMTP id m140so3950357itg.2 for ; Tue, 28 May 2019 06:42:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=2U2VprK+xJ2wl2sWd6xnQKaeeJWKQT/VbOVNw2VNEho=; b=BsaiGLIPigybUZnuXzmP17m4y2MN0qmOez72k/QzGe8E+bgastVmzPXvhmHy7Mm1lp XV1BWbIk2KHAZ3SCDXWPD/r+3YYgFFUfEr43lgD73Nf60uHGJcZ4gdlrjUL+C026AX25 lViHmplIbbN1GNHeZyxsJjJCTp8zkLTSZfRr9fx4MIHxduvzjX9s1zfemfOal8ZAPGVg XpwuGLv/xdxFsrYXCQXDou5t2KiwWNS8NS8+XFhswRTKt/uvb2uwZlFbEuB5MX/L7r8+ uBfC0pawGm1doHPMblzWvmUJyNDpIwS+IJ7Yk4YpTuKe+vHXuBIWVI82yLr5t5/2Nscp nf6w== X-Gm-Message-State: APjAAAUriG4EH9jg+WgoHs27kpGr6eE6T+p5d0pb7DRgYNHP4FfGgp7J 6wFFzfSOoLtA1Sk/W2RIxy5/cegj/9ICb/+Zl8Ky+qDD X-Google-Smtp-Source: APXvYqyu1mUasuiDF41ErtwpPnZeHHXXFE+6hM5hWLi9ll6Uwr3LfKRQk+xW9F9t6Ol2NqwpO5m+10+Sa0FHMW3roso= X-Received: by 2002:a02:6a06:: with SMTP id l6mr12225987jac.129.1559050977339; Tue, 28 May 2019 06:42:57 -0700 (PDT) MIME-Version: 1.0 From: Ed Maste Date: Tue, 28 May 2019 03:13:41 -0400 Message-ID: Subject: Speeding up slower Git operations To: freebsd-git@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 5F84E816BD X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.176 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.27 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-git@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; RCVD_IN_DNSWL_NONE(0.00)[176.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; DMARC_NA(0.00)[freebsd.org]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; IP_SCORE(-2.30)[ip: (-5.76), ipnet: 209.85.128.0/17(-3.39), asn: 15169(-2.29), country: US(-0.06)]; TO_DOM_EQ_FROM_DOM(0.00)[] X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 13:43:00 -0000 Microsoft has been putting a lot of work into improving git performance and scalability with large repositories. A recent development is the addition of the commit-graph feature[1], which caches information about the commit graph and speeds up operations like determining if a commit is on a specified branch, or obtaining the commit count. As an example of the performance gain, the feature's developer reports that a "git branch --contains" on the Linux kernel went from 76.20s to 0.04s. In my FreeBSD tree "git rev-list HEAD --count" went from an average of 2.77s wall clock to 0.39s. This operation (rev-list --count) is interesting as it can serve as a replacement for monotonically increasing version numbers, and with it executing in under half a second it seems like it'd be reasonable to add it to newvers.sh (to bake into uname). To enable the feature, enable the commitGraph option: % git config core.commitGraph true Then populate the commit graph: % git commit-graph write --reachable If you try it please reply and let us know how it worked for you. [1] https://devblogs.microsoft.com/devops/supercharging-the-git-commit-graph/