Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 911A320970 for ; Tue, 11 Apr 2017 21:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753784AbdDKVf2 (ORCPT ); Tue, 11 Apr 2017 17:35:28 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33258 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753767AbdDKVf0 (ORCPT ); Tue, 11 Apr 2017 17:35:26 -0400 Received: by mail-pf0-f195.google.com with SMTP id c198so1676768pfc.0 for ; Tue, 11 Apr 2017 14:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XCL8bAZSs4eP7Uri03cjXPNp85j1AZo5hq62H+lxiqg=; b=kvS+vxBMXD+qHLrYR7B/9iMn3DQlCYa9IqLQu+Rsf0Vfuc7P99+YJNED6LxVQ3tXE8 L8OdQXvNQ/JHHOWj728riAYYbSgD4pvT99dUkylZhijFsD8O5SvumnhiN9NdpZlAMG/W yiuBX/YyC31Q8wxb7c4cmWtbLRYf+PHx7H4ycswoFakzwo2O4uj1ro6scNBWiW6vuTl+ vu8CK134jC4PWFzB0QK+QvZySDMGsGXmSI5NICxYdMMeYUu8S+lI6vE1iIBypX89vesJ O2wMklQnXSfJk4PbpJikcaUYTgjdZrP62wdQkHhCKJEzygm6BbHeJVzW0nDX0Pxt7nv0 OTiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XCL8bAZSs4eP7Uri03cjXPNp85j1AZo5hq62H+lxiqg=; b=Qa8Enh6R8GZwD791gD14kMpCHDgVw9ylYN0sSTVrhFce17DG9ZhyloYREskxIQgjJY V6B5bQuz/mhckdhTkbmymvP64YEO+vJMTUm84a76Koxs7d+o79tcF8AM3QZuN4LgJhnV OTzuAH09g0lMnHGHihOrV9Q7KhW5gDGV5j3HBMNTK167gpyYIvRLSUDo34Mwd0VLTpU8 Haz0s1tSy04fnBZMALQGv3pN4iBOJB/H270PGSYBbka/XEADSGUwc9sUILkXda+OQIud cATJ4ZsYck0kJYOzqFgmck2VBO4AUpa/gtP01aoEUs8RahKmpa+AwdSgqKiwTuLeBlMo 51ow== X-Gm-Message-State: AN3rC/6+Ju3jIw0T5w8y91AQOM5bXXpa2ICPEssb43zWGD0NhOCn0ue4wZpPbdTP42XX7g== X-Received: by 10.98.150.221 with SMTP id s90mr25238884pfk.15.1491946525719; Tue, 11 Apr 2017 14:35:25 -0700 (PDT) Received: from aiede.mtv.corp.google.com ([2620:0:1000:5b10:c434:5e79:6b7e:ed6b]) by smtp.gmail.com with ESMTPSA id r18sm7658543pfk.109.2017.04.11.14.35.24 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 11 Apr 2017 14:35:25 -0700 (PDT) Date: Tue, 11 Apr 2017 14:35:23 -0700 From: Jonathan Nieder To: git@jeffhostetler.com Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net, Jeff Hostetler Subject: Re: [PATCH v4 2/2] p0005-status: time status on very large repo Message-ID: <20170411213523.GQ8741@aiede.mtv.corp.google.com> References: <20170411200802.31638-1-git@jeffhostetler.com> <20170411200802.31638-3-git@jeffhostetler.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170411200802.31638-3-git@jeffhostetler.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, Jeff Hostetler wrote: > Signed-off-by: Jeff Hostetler Usually the commit message is a place to put some of the motivation behind the patch or why I should want to apply it. In this example, everything is answered by the previous patch, which suggests that it would be easier to understand if they were squashed into a single patch. [...] > +++ b/t/perf/p0005-status.sh > @@ -0,0 +1,51 @@ > +#!/bin/sh > +## > +## This test measures the performance of various read-tree > +## and status operations. It is primarily interested in > +## the algorithmic costs of index operations and recursive > +## tree traversal -- and NOT disk I/O on thousands of files. Nit: git usually uses a single # to start comments in shell scripts (and likewise below). [...] > +## If the test repo was generated by ./repos/many-files.sh > +## then we know something about the data shape and branches, > +## so we can isolate testing to the ballast-related commits > +## and setup sparse-checkout so we don't have to populate > +## the ballast files and directories. > +## > +## Otherwise, we make some general assumptions about the > +## repo and consider the entire history of the current > +## branch to be the ballast. > + > +git branch | grep p0006-ballast >/dev/null 2>&1 > +synthetic=$? > +if test "$synthetic" = 0 nit: no need to run a command and read $? when using the command directly from if would do: if git branch | grep p0006-ballast This can be simplified further by using a lower-level command for the test: if git rev-parse --verify refs/heads/p0006-ballast^{commit} > +then > + echo Assuming synthetic repo from many-files.sh > + git branch br_base master > + git branch br_ballast p0006-ballast > + echo '/*' >.git/info/sparse-checkout > + echo '!ballast/*' >>.git/info/sparse-checkout > + git config --local core.sparsecheckout 1 > +else > + echo Assuming non-synthetic repo... > + git branch br_base $(git rev-list HEAD | tail -n 1) > + git branch br_ballast HEAD > +fi This kind of setup instructions usually go in a test_expect_success block so that the perf harness can detect whether they failed. > + > +test_expect_success 'setup' ' > + git checkout -q br_ballast nit: no need to use "-q" --- most output from test_expect_success is suppressed unless the script is run with "-v", at which point it becomes useful for debugging. > +' > + > +nr_files=$(git ls-files | wc -l) This also can go in the test_expect_success block. > + > +test_perf "read-tree status br_ballast ($nr_files)" ' > + git read-tree HEAD && > + git status > +' Looks nice and simple. Thanks for writing it. Hope that helps, Jonathan