From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 245ECC433FE for ; Tue, 28 Sep 2021 23:33:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 036B26136F for ; Tue, 28 Sep 2021 23:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243324AbhI1Xet (ORCPT ); Tue, 28 Sep 2021 19:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243296AbhI1Xek (ORCPT ); Tue, 28 Sep 2021 19:34:40 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2A33C061760 for ; Tue, 28 Sep 2021 16:32:59 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id d21so1058528wra.12 for ; Tue, 28 Sep 2021 16:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=THp3oyYMQZ0IyvYbWDVtqI55HStotyepThNgwaAMuqY=; b=OcTgiBD6bHtPiNjBeCeCE2qzsKY8Ds6qbTAi28kkLi4/Ub4ebWQcxn4rNwe/K3C80H seSaV3QU2tzbAC9sIxBTHOCQdfb0kxxa1Vdv2aYC/sghmuyTIKv5XGJnzywNTIERxMjm ZWrM+c43/84Tu79enXppMTJIzM4NnUoXJslw6gP5mQ3GeMkVl7O07mmOlLauaK0dMVAA uU+kkYGcZLoHbXKl2rqn4ceMOnHFbKkLHRg9Rgnj3qnED93q00GZMbqMkwkAOoZwIY2Z 1v3iiAQrxqHr6O+qVAPrCAveTV+IRJ8z4LDF/jsz6W+wYlTbdobbBwKoCC3Bur1hIsoz YcSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=THp3oyYMQZ0IyvYbWDVtqI55HStotyepThNgwaAMuqY=; b=4vU+9sJLvYyFMFzetiStI8UkNeeDC2WK9QKZ8OgppciavAS25zCuAuizQWjAQRS6BF nW1nNHCplUyVqA3Okdru5xSATCS6buSrQX1gKVay/lXWIUsB/5nDs1oi+Yu/js9ZT+FK B/aHJ2F48pv33oYW5IyXrTzxu+XogqW2r3juAyJfxxfIO4zHOqJZQ7pCOaEiP6PpvB/F pYSAnZzj5JW/vnhwWK97upGe4lQE09XjsYBgj3L78lo+7a+PPD32eJkbSBsnZ95pdlN7 xgbftrcr5++yHadUyKep9z9vEB8CWAuTV8l/1pn78pDnmu1B6C7eMuqwg2hqBnTHtHVr c0jg== X-Gm-Message-State: AOAM532NzMciBTqHGVQOfPp7DWdwzE0GF2O6vESRnfUz6FJ9JB0/OTfS PnH1yQwMA05kCD7/IhZHuNrA9ZNLGrQ= X-Google-Smtp-Source: ABdhPJyJOqmmzsZFOuD5B+ttleB6ureIhKQxCnvcWRw+4m5uEI9htzBwLhHLdsU9MSottwmhstT3/A== X-Received: by 2002:a05:6000:1546:: with SMTP id 6mr3188593wry.305.1632871978412; Tue, 28 Sep 2021 16:32:58 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q126sm4033476wma.10.2021.09.28.16.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 16:32:58 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Neeraj Singh via GitGitGadget" Date: Tue, 28 Sep 2021 23:32:51 +0000 Subject: [PATCH v7 9/9] core.fsyncobjectfiles: performance tests for add and stash Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 To: git@vger.kernel.org Cc: Neeraj-Personal , Johannes Schindelin , Jeff King , Jeff Hostetler , Christoph Hellwig , =?UTF-8?Q?=C3=86var_Arnfj=C3=B6r=C3=B0?= Bjarmason , "Randall S. Becker" , Bagas Sanjaya , "Neeraj K. Singh" , Neeraj Singh Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Neeraj Singh Add a basic performance test for "git add" and "git stash" of a lot of new objects with various fsync settings. Signed-off-by: Neeraj Singh --- t/perf/p3700-add.sh | 43 ++++++++++++++++++++++++++++++++++++++++ t/perf/p3900-stash.sh | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100755 t/perf/p3700-add.sh create mode 100755 t/perf/p3900-stash.sh diff --git a/t/perf/p3700-add.sh b/t/perf/p3700-add.sh new file mode 100755 index 00000000000..e93c08a2e70 --- /dev/null +++ b/t/perf/p3700-add.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# This test measures the performance of adding new files to the object database +# and index. The test was originally added to measure the effect of the +# core.fsyncObjectFiles=batch mode, which is why we are testing different values +# of that setting explicitly and creating a lot of unique objects. + +test_description="Tests performance of add" + +. ./perf-lib.sh + +. $TEST_DIRECTORY/lib-unique-files.sh + +test_perf_default_repo +test_checkout_worktree + +dir_count=10 +files_per_dir=50 +total_files=$((dir_count * files_per_dir)) + +# We need to create the files each time we run the perf test, but +# we do not want to measure the cost of creating the files, so run +# the tet once. +if test "${GIT_PERF_REPEAT_COUNT-1}" -ne 1 +then + echo "warning: Setting GIT_PERF_REPEAT_COUNT=1" >&2 + GIT_PERF_REPEAT_COUNT=1 +fi + +for m in false true batch +do + test_expect_success "create the files for core.fsyncObjectFiles=$m" ' + git reset --hard && + # create files across directories + test_create_unique_files $dir_count $files_per_dir files + ' + + test_perf "add $total_files files (core.fsyncObjectFiles=$m)" " + git -c core.fsyncobjectfiles=$m add files + " +done + +test_done diff --git a/t/perf/p3900-stash.sh b/t/perf/p3900-stash.sh new file mode 100755 index 00000000000..c9fcd0c03eb --- /dev/null +++ b/t/perf/p3900-stash.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# +# This test measures the performance of adding new files to the object database +# and index. The test was originally added to measure the effect of the +# core.fsyncObjectFiles=batch mode, which is why we are testing different values +# of that setting explicitly and creating a lot of unique objects. + +test_description="Tests performance of stash" + +. ./perf-lib.sh + +. $TEST_DIRECTORY/lib-unique-files.sh + +test_perf_default_repo +test_checkout_worktree + +dir_count=10 +files_per_dir=50 +total_files=$((dir_count * files_per_dir)) + +# We need to create the files each time we run the perf test, but +# we do not want to measure the cost of creating the files, so run +# the tet once. +if test "${GIT_PERF_REPEAT_COUNT-1}" -ne 1 +then + echo "warning: Setting GIT_PERF_REPEAT_COUNT=1" >&2 + GIT_PERF_REPEAT_COUNT=1 +fi + +for m in false true batch +do + test_expect_success "create the files for core.fsyncObjectFiles=$m" ' + git reset --hard && + # create files across directories + test_create_unique_files $dir_count $files_per_dir files + ' + + # We only stash files in the 'files' subdirectory since + # the perf test infrastructure creates files in the + # current working directory that need to be preserved + test_perf "stash 500 files (core.fsyncObjectFiles=$m)" " + git -c core.fsyncobjectfiles=$m stash push -u -- files + " +done + +test_done -- gitgitgadget