From patchwork Sat Oct 17 21:04:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Vandiver X-Patchwork-Id: 11842999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA080C433DF for ; Sat, 17 Oct 2020 21:04:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F7C2207BC for ; Sat, 17 Oct 2020 21:04:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MC/8UL1R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439458AbgJQVEl (ORCPT ); Sat, 17 Oct 2020 17:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439450AbgJQVEl (ORCPT ); Sat, 17 Oct 2020 17:04:41 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8CF0C061755 for ; Sat, 17 Oct 2020 14:04:40 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id 13so6704981wmf.0 for ; Sat, 17 Oct 2020 14:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=7p7HYzVQTY1ynw8rjsFhzxNNXaJqnM6pIlRGWVFciSY=; b=MC/8UL1RYFr00X3Pc8kKR91bu9eHhxbf9YDpDSZAmws9jkvLDwhTao9h4Ml3C5J2WL xAIBB+JsQ4m0o3AcXrzlt2WVkcMAYEmZEHWkyrAj6QBbHQtJipEt8PXVOXNjGQFZoyjU 1+qFyC+6LHr3f82Zg1JM6V0lVpSwLMXQ2XI/SmTNpSJBYKy2q2lf7l+Xycdcv7BRHzIg K2zSck5IUtEZfGAj/XTIXtw0uCkPWAXV1Dm1sdL60lOanVL1p824E9k+eC9cGk+AcyUE R/g+4b3f+slF9PyFWd56lFzUJqA+XYPMRADojntkcX3ZrwBHt/qVR2gHG/Ag7E1JFYO1 eMmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=7p7HYzVQTY1ynw8rjsFhzxNNXaJqnM6pIlRGWVFciSY=; b=BT2y2svYFZfvulm/WYhUtTkD4sRVfWthE0OFIpnK3thZQkPQc2bO6wvPnxP+sW+W9M wnMwGDcsbjkWbBusavlxdotgdLifZKOB0YBxH7Exu3g58q8/YhP7mFYJx5uZ61H3trFc JtmDn93VpjMD06K/DNGXRqtIdjvP3qjfWxqr9JyeJIhXoKV+Yp1847080iFxscQ3XtzY K54+ElPHPOy8G/hn8z4MH53sr7qwOic0Lc4f3cIPIvjTom5hoCB7zwfKQnNn1DpNuwMi lrAgrbIfEEWEQBEQ3unrXE5SHn0Gs3HHzyDhcC/cBy3tPS0t7ILBsozdWv92zPffSJqm RS9w== X-Gm-Message-State: AOAM5303RHpU/C7WhOW6J6m1+gxyABbBsECdcqhdWVfunmrH2qTF7zhS 6al3AFARlbak3HKbeY7jtyuDY3fGGNQ= X-Google-Smtp-Source: ABdhPJzNcgVKH2GN1f9rWUtT5pnbSjC1qk50jQz7hfn3k17zTLdYdm3RgsErkTYFMino8M5mOkdhOQ== X-Received: by 2002:a1c:1f89:: with SMTP id f131mr10302542wmf.10.1602968679473; Sat, 17 Oct 2020 14:04:39 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n5sm10526035wrm.2.2020.10.17.14.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 14:04:38 -0700 (PDT) Message-Id: <13fd992a375e30e8c7b0953a128e149951dee0ea.1602968677.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 17 Oct 2020 21:04:33 +0000 Subject: [PATCH 1/4] fsmonitor: use fsmonitor data in `git diff` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Derrick Stolee , Utsav Shah , Nipunn Koorapati , Alex Vandiver Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Alex Vandiver From: Alex Vandiver With fsmonitor enabled, the first call to match_stat_with_submodule calls refresh_fsmonitor, incurring the overhead of reading the list of updated files -- but run_diff_files does not respect the CE_FSMONITOR_VALID flag. Make use of the fsmonitor extension to skip lstat() calls on files that fsmonitor judged as unmodified. Notably, this change improves performance of the git shell prompt when GIT_PS1_SHOWDIRTYSTATE is set. Signed-off-by: Alex Vandiver Signed-off-by: Nipunn Koorapati --- diff-lib.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/diff-lib.c b/diff-lib.c index f95c6de75f..b7ee1b89ef 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -97,6 +97,8 @@ int run_diff_files(struct rev_info *revs, unsigned int option) diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/"); + refresh_fsmonitor(istate); + if (diff_unmerged_stage < 0) diff_unmerged_stage = 2; entries = istate->cache_nr; @@ -197,8 +199,19 @@ int run_diff_files(struct rev_info *revs, unsigned int option) if (ce_uptodate(ce) || ce_skip_worktree(ce)) continue; - /* If CE_VALID is set, don't look at workdir for file removal */ - if (ce->ce_flags & CE_VALID) { + /* + * If CE_VALID is set, the user has promised us that the workdir + * hasn't changed compared to index, so don't stat workdir + * for file removal + * eg - via git udpate-index --assume-unchanged + * eg - via core.ignorestat=true + * + * When using FSMONITOR: + * If CE_FSMONITOR_VALID is set, then we know the metadata on disk + * has not changed since the last refresh, and we can skip the + * file-removal checks without doing the stat in check_removed. + */ + if (ce->ce_flags & CE_VALID || ce->ce_flags & CE_FSMONITOR_VALID) { changed = 0; newmode = ce->ce_mode; } else { From patchwork Sat Oct 17 21:04:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipunn Koorapati X-Patchwork-Id: 11843001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EC76C43457 for ; Sat, 17 Oct 2020 21:04:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29881207BC for ; Sat, 17 Oct 2020 21:04:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cMajH7zS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439461AbgJQVEn (ORCPT ); Sat, 17 Oct 2020 17:04:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439457AbgJQVEl (ORCPT ); Sat, 17 Oct 2020 17:04:41 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 959C0C061755 for ; Sat, 17 Oct 2020 14:04:41 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id b8so7275247wrn.0 for ; Sat, 17 Oct 2020 14:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=YDGjg72DiBHMJo7ao0V16mKGbZgzL/e6IJE1LLIK85I=; b=cMajH7zSdkLm+qZ3cqVzIE/O99bZnVFntcmBYKAy+C0273QNvaywsPsJaXqTgXH/U7 fsyoBgZMorSfjWFbY5kq4Ma18G7ezjtrn8dVKeVinyH//J/1K9hjQWYWAYiGch65tMQK fYGhicIaQEUNUyd5sBV+bktujA9eX8zxRx8pTJQM2G8p3jFpZtBBXuR/foC3abexJuTP rbS5YF6mJej2V7+F+2Ld/gkMHKEA2m6f6ak/4j8FRK0AHFMocIie6i37t+zR8wl0SgCj XXbrAeDQQN43p4BwINzgeAVDSH2u3kpgwGoFahCQywCfNOd4zqzTob1GZaRTRcTXFUf3 yJ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=YDGjg72DiBHMJo7ao0V16mKGbZgzL/e6IJE1LLIK85I=; b=RxihFwZaYHU4mrORGsCiteTcbKPGdxK8VCKOOW3dvoJJPUIaY0oDa5QYVpYo6n9asZ P/onBZPGYUQrcqp8s+q4FmN2BQPLUzyjo3N5hFI9x/xwwCKJ/bDIxCZAto2cLiE4Psaj 0YHgLUKFaz1Kew8pkKvoJSGctrJidoA8NLpcwcSnu6crIPwUn3YMATLJuYiiOhNvKhIB 2icTscIIyJ6MHoNLLPemkN1xnAD9ILci6ea7p3tdREetfvoa2SBSZ2G6VjaaiX8OVEwD 3zS0wSUTq3LtysSf2DueHEg2HY38UjlwqvZ+cTcpnucSWGAVL1f+xDOc5yvhxnweU/0e YFsQ== X-Gm-Message-State: AOAM532/EBwBVbqtExlAFbvHg7YpScUEpScNw0hNyQ6hXTZNgg64hHek STnfFfnyb2ojtjnKhYcEke2YwkPo+s4= X-Google-Smtp-Source: ABdhPJwaawTfLf1VZ9fAGOGghd01LCNREe8hhdxV4icQ0RvCa/ZAAulrws3+9vOzXb5SOW1dwvG0iA== X-Received: by 2002:adf:fdc7:: with SMTP id i7mr12332501wrs.198.1602968680238; Sat, 17 Oct 2020 14:04:40 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id x21sm9825884wmi.3.2020.10.17.14.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 14:04:39 -0700 (PDT) Message-Id: <024cd079654a0f0ecf6fe29976f8274efff58e49.1602968677.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 17 Oct 2020 21:04:34 +0000 Subject: [PATCH 2/4] t/perf/README: elaborate on output format Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Derrick Stolee , Utsav Shah , Nipunn Koorapati , Nipunn Koorapati Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Nipunn Koorapati From: Nipunn Koorapati Signed-off-by: Nipunn Koorapati --- t/perf/README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/perf/README b/t/perf/README index bd649afa97..fb9127a66f 100644 --- a/t/perf/README +++ b/t/perf/README @@ -28,6 +28,8 @@ the tests on the current git repository. 7810.3: grep --cached, cheap regex 3.07(3.02+0.25) 7810.4: grep --cached, expensive regex 9.39(30.57+0.24) +Output format is in seconds "Elapsed(User + System)" + You can compare multiple repositories and even git revisions with the 'run' script: From patchwork Sat Oct 17 21:04:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipunn Koorapati X-Patchwork-Id: 11843003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 948A1C433DF for ; Sat, 17 Oct 2020 21:04:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A7CB207BC for ; Sat, 17 Oct 2020 21:04:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gLbg7ukH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439457AbgJQVEq (ORCPT ); Sat, 17 Oct 2020 17:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439459AbgJQVEm (ORCPT ); Sat, 17 Oct 2020 17:04:42 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593B7C061755 for ; Sat, 17 Oct 2020 14:04:42 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id i1so7253303wro.1 for ; Sat, 17 Oct 2020 14:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Djf3TWO3UFcf03qpN2acJDVn06wf04grB536pabMBck=; b=gLbg7ukHTuMqqjWgkrOdGnxS+tGe/waLXCXf7TmrhfOroajh6wySHqUUlU0U/D3jQH WrJwDIbXeBZyirH4mVTcjfFzWzWo/XWOQngVXU9W9N87/dscn4LGAFch2T9dfOOPXa/M F/W35mdMuDbS540cgnzlt0rShXko9vap+F5s3Rif+bzps+4hKrxmChdlVQMnT2cB22gn n0Tue2nUHhC6TWWTsq297mAgE+TfvZxpSiO0T3C+4rtjB5RAxZqfDxfStwYs4vNgJ/yK YjSvuwDlihyLveLZjND2JJ4YVS2QM4H5CC8BWVAj9D9QvoXW63xiBb/6cr7HvhRkChKs 5Fsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Djf3TWO3UFcf03qpN2acJDVn06wf04grB536pabMBck=; b=m5f/puTmE1u4ZlmEZBW9GoobRL2x1g56wHF0MZkDGvaxK8p2BRaJxHIfFMi73KMDN9 A9aa4ce87YNcFpnk/DbI+70rB+1kcrj2JARA4zTRBtcTo6trSeSXTLJcBHojmqzQtrwq ypfXKBkNBIASuCI8UIS7dGEs9K+3w2WEz/fglzqoj+9m3L2+2VGwLzBhGk5r9SelYYFr cM5CkPp31EhaGebdv/muWpUj8fNv6/UDWjCbF4plXJ6eAEnfcgixGP1ADAjX31bu5XN4 G9oobHce18UyQFV4e4/5yWs7lnPI9SiGeebzWzSf+QDjkZamV9zO4MiaCVU2Y4G9yKUj icTA== X-Gm-Message-State: AOAM532VKgsCvZ2r73mUnsFECvf3AlmGCUFQsk++vq3dbZrPPOInyUnC Kr+XU7FbjT8jXim5bPR/U3NZ3vJ1Bfg= X-Google-Smtp-Source: ABdhPJwVcjWDzvb2qIkJqBBSf+HucU9Z4Hz/pyVkFj5iDZKd/TA4lkNZTOSF/HoVqscNPQ7ceoosBw== X-Received: by 2002:adf:a31a:: with SMTP id c26mr11157507wrb.378.1602968680998; Sat, 17 Oct 2020 14:04:40 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a3sm8723213wmb.46.2020.10.17.14.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 14:04:40 -0700 (PDT) Message-Id: <6482e372bc0dca08efe9686b5b9e06a27a1d7a70.1602968677.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 17 Oct 2020 21:04:35 +0000 Subject: [PATCH 3/4] t/perf/p7519-fsmonitor.sh: warm cache on first git status Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Derrick Stolee , Utsav Shah , Nipunn Koorapati , Nipunn Koorapati Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Nipunn Koorapati From: Nipunn Koorapati The first git status would be inflated due to warming of filesystem cache. This makes the results comparable. Before Test this tree -------------------------------------------------------------------------------- 7519.2: status (fsmonitor=.git/hooks/fsmonitor-watchman) 2.52(1.59+1.56) 7519.3: status -uno (fsmonitor=.git/hooks/fsmonitor-watchman) 0.18(0.12+0.06) 7519.4: status -uall (fsmonitor=.git/hooks/fsmonitor-watchman) 1.36(0.73+0.62) 7519.7: status (fsmonitor=) 0.69(0.52+0.90) 7519.8: status -uno (fsmonitor=) 0.37(0.28+0.81) 7519.9: status -uall (fsmonitor=) 1.53(0.93+1.32) After Test this tree -------------------------------------------------------------------------------- 7519.2: status (fsmonitor=.git/hooks/fsmonitor-watchman) 0.39(0.33+0.06) 7519.3: status -uno (fsmonitor=.git/hooks/fsmonitor-watchman) 0.17(0.13+0.05) 7519.4: status -uall (fsmonitor=.git/hooks/fsmonitor-watchman) 1.34(0.77+0.56) 7519.7: status (fsmonitor=) 0.70(0.53+0.90) 7519.8: status -uno (fsmonitor=) 0.37(0.32+0.78) 7519.9: status -uall (fsmonitor=) 1.55(1.01+1.25) Signed-off-by: Nipunn Koorapati --- t/perf/p7519-fsmonitor.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index def7ecdbc7..9313d4a51d 100755 --- a/t/perf/p7519-fsmonitor.sh +++ b/t/perf/p7519-fsmonitor.sh @@ -114,7 +114,8 @@ test_expect_success "setup for fsmonitor" ' fi && git config core.fsmonitor "$INTEGRATION_SCRIPT" && - git update-index --fsmonitor + git update-index --fsmonitor && + git status # Warm caches ' if test -n "$GIT_PERF_7519_DROP_CACHE"; then From patchwork Sat Oct 17 21:04:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipunn Koorapati X-Patchwork-Id: 11843005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18663C433E7 for ; Sat, 17 Oct 2020 21:04:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D87F5207BC for ; Sat, 17 Oct 2020 21:04:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N8+GRjcn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439464AbgJQVEo (ORCPT ); Sat, 17 Oct 2020 17:04:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439457AbgJQVEn (ORCPT ); Sat, 17 Oct 2020 17:04:43 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20928C0613CE for ; Sat, 17 Oct 2020 14:04:43 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id p15so6674599wmi.4 for ; Sat, 17 Oct 2020 14:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=fiM/7tQv3ckg1OC9FGkO5P4pSEVpKlahFOZem86XI6s=; b=N8+GRjcnKI9z8/9/+7spyMjHtSo6L+wwoHhQQCmut8DiMODU8XNmERfbSp3K8N3RAL GG0EgTD0syr6IlYQ7nMBLlXSXy8gA4dSQEUhaw1FVeB4mQl9gkI/od/tyDmtwesXreQt S7V+0G7ileESrW0iQIwr3wAYYqfp9wwSuvDGD5YR/595QkVPzpy2UM8Z7vgjTMcF8+CF MBJ5agO10D30p6b5tvdEGNNJPUmUDf9awMIOJdd5zrA7SAei/OoR6jmnRRXoewMjW97o F44Pd+XAzP9AViWUnHC493FDpeky9JskHI+DeXQ9qp+V0DEb2WZFEBd7O7FpPQO96aem xO/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=fiM/7tQv3ckg1OC9FGkO5P4pSEVpKlahFOZem86XI6s=; b=Te8jaV72vthgJQF2vB/iARFMEp3KZ6fvLd0ss6kqt01YjGSkrcaEe1jDS9MBc2HRLN 9uNCIeNV8YqBTNa2WuM4JT+grlhshbzI2kc5G/pZWu4ksxRpxG8oC4vdMO9bpDfEmaAU x7Nr8S4hTW1p+1o37d6cMQAo4uw8taieQvatymWSQ0Dso0izI+4gjLNKcqEa+y52c1I8 nhl65jHAyoA7BYzlJwTQWcdVASH9OG6XX5eckZ+qoOZpXtF1xvET3aiJDbP2OSJ8MWkC An8aBH1LosahnLYcc0fPAW2l8dxiAMqHJHv0QxdNStIq/3mgf0ZWiBl9AvVjkckJRVa1 uZrA== X-Gm-Message-State: AOAM533UDsGf2Lr0IKNit0P97zAHUZqTli0TJ12B0Hq+XVY/wGSjRRHs aYvbI9v7nn8zgiINHkAWrh3cvTV7KPo= X-Google-Smtp-Source: ABdhPJw6/Vb+I2cL9jiarqk2uTBu9AN3JiNb4xgyib9s8tDEQRWtaCR4O0NentJhYJMbKNnTYYflKQ== X-Received: by 2002:a1c:2905:: with SMTP id p5mr10174937wmp.187.1602968681708; Sat, 17 Oct 2020 14:04:41 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o194sm9016001wme.24.2020.10.17.14.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 14:04:41 -0700 (PDT) Message-Id: <0613b07676e8abd0b4f342784b94d11174981537.1602968677.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 17 Oct 2020 21:04:36 +0000 Subject: [PATCH 4/4] t/perf: add fsmonitor perf test for git diff Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Derrick Stolee , Utsav Shah , Nipunn Koorapati , Nipunn Koorapati Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Nipunn Koorapati From: Nipunn Koorapati Results for the git-diff fsmonitor optimization in patch in the parent-rev (using a 400k file repo to test) As you can see here - git diff with fsmonitor running is significantly better with this patch series (80% faster on my workload)! On master (2.29) Test this tree -------------------------------------------------------------------------------- 7519.2: status (fsmonitor=.git/hooks/fsmonitor-watchman) 0.39(0.33+0.06) 7519.3: status -uno (fsmonitor=.git/hooks/fsmonitor-watchman) 0.17(0.13+0.05) 7519.4: status -uall (fsmonitor=.git/hooks/fsmonitor-watchman) 1.34(0.77+0.56) 7519.5: diff (fsmonitor=.git/hooks/fsmonitor-watchman) 0.82(0.24+0.58) 7519.7: status (fsmonitor=) 0.70(0.53+0.90) 7519.8: status -uno (fsmonitor=) 0.37(0.32+0.78) 7519.9: status -uall (fsmonitor=) 1.55(1.01+1.25) 7519.10: diff (fsmonitor=) 0.34(0.35+0.72) With this patch series Test this tree -------------------------------------------------------------------------------- 7519.2: status (fsmonitor=.git/hooks/fsmonitor-watchman) 0.39(0.33+0.07) 7519.3: status -uno (fsmonitor=.git/hooks/fsmonitor-watchman) 0.17(0.12+0.05) 7519.4: status -uall (fsmonitor=.git/hooks/fsmonitor-watchman) 1.35(0.73+0.61) 7519.5: diff (fsmonitor=.git/hooks/fsmonitor-watchman) 0.14(0.10+0.05) 7519.7: status (fsmonitor=) 0.70(0.56+0.87) 7519.8: status -uno (fsmonitor=) 0.37(0.31+0.79) 7519.9: status -uall (fsmonitor=) 1.54(0.97+1.29) 7519.10: diff (fsmonitor=) 0.34(0.28+0.79) Signed-off-by: Nipunn Koorapati --- t/perf/p7519-fsmonitor.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index 9313d4a51d..80d0148557 100755 --- a/t/perf/p7519-fsmonitor.sh +++ b/t/perf/p7519-fsmonitor.sh @@ -142,6 +142,14 @@ test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" ' git status -uall ' +if test -n "$GIT_PERF_7519_DROP_CACHE"; then + test-tool drop-caches +fi + +test_perf "diff (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff +' + test_expect_success "setup without fsmonitor" ' unset INTEGRATION_SCRIPT && git config --unset core.fsmonitor && @@ -172,6 +180,14 @@ test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" ' git status -uall ' +if test -n "$GIT_PERF_7519_DROP_CACHE"; then + test-tool drop-caches +fi + +test_perf "diff (fsmonitor=$INTEGRATION_SCRIPT)" ' + git diff +' + if test_have_prereq WATCHMAN then watchman watch-del "$GIT_WORK_TREE" >/dev/null 2>&1 &&