From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08A473537F7 for ; Fri, 3 Jul 2026 05:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783057328; cv=none; b=HcOHwqgtU8EEdilX0bEl8eIk4de+eVMNEimxpF7oBoxG0hhwMFcTDW8pTn5I4s3ZK8A7gxW08k8XjUynmIXn6bvsv4ZfmUQAoa0am19Oe6p6BQZp0DQI3RqhVIdfRbw+Ev/IzNY/4eaObU/sjNDmqvGCENR4uGpPA4rJkLh5TkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783057328; c=relaxed/simple; bh=0xFkhJqXa/wcmz+vQlawohAExYSdnK08KJGFuy+ke5E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XL6OaMRsHbVX7rAlkJCa/jJxncBwVHyNM7Um5XlvHGauzH1QrjUO0CQVMrpHJuPG3YP+m4uHiz96r03WhucoGhqtyqjHGYWdq634ZLapJ0/Im7pXFXX3Q9lv3W+AzzMfsh/QGx0i22WUEkspkrczCuNveKGML+3+uNBM0iWo338= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=CF4wr+Kz; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Zu2GlhBy; arc=none smtp.client-ip=202.12.124.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="CF4wr+Kz"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Zu2GlhBy" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 5582F7A001C; Fri, 3 Jul 2026 01:42:06 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Fri, 03 Jul 2026 01:42:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1783057326; x=1783143726; bh=/cP/t3Cyng 0B7NmBnYLhH2VDPCjozRjH5wW3uNwK4GM=; b=CF4wr+KzbSHrqB+z8vu9cV9n7G w6gsQVUXQMWy1NKBQxVrLS8yXsHEQZj3f/xgvpbRe9885qcUs3UV/VemAYBZo5f7 TK3PXHc1y2X0FYzWB9hm92imoqa7wQ639dUk0ephzyQhDqGD7MQpxxT2h8gFt7LA u/RcDjvJCvKFAvXqMjTeOukTxnUqGc7bKUjmJlYQltdotLFkE3KzrBpOkuuTmZ81 jC9sL5Zgio5BK3Yq70wswyjm5zIH5J/tJnX81/zOiws7HojDCeEVrJv9Y4E9nVSX wE/nOnLPXBkyDRr4Gw//tKc+aPg8hDTMZfNnVTx9S3dLkA2itwfiqVCGSQ1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1783057326; x=1783143726; bh=/cP/t3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/dXcn+LraCnNrdOOd2W1W3EsCifbug0qUkytLANXv+HzGHJqG3A X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jul 2026 01:42:05 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id 03990491 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 3 Jul 2026 05:42:02 +0000 (UTC) Date: Fri, 3 Jul 2026 07:42:00 +0200 From: Patrick Steinhardt To: Jeff King Cc: git@vger.kernel.org, Junio C Hamano , Johannes Schindelin Subject: Re: [PATCH 3/9] t4141: fix inefficient use of dd(1) Message-ID: References: <20260702-b4-pks-t-fixes-for-GIT-TEST-LONG-v1-0-76b4d7bab3d0@pks.im> <20260702-b4-pks-t-fixes-for-GIT-TEST-LONG-v1-3-76b4d7bab3d0@pks.im> <20260702211614.GB2051171@coredump.intra.peff.net> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260702211614.GB2051171@coredump.intra.peff.net> On Thu, Jul 02, 2026 at 05:16:14PM -0400, Jeff King wrote: > On Thu, Jul 02, 2026 at 02:00:56PM +0200, Patrick Steinhardt wrote: > > > This test setup is extremely expensive, as `test_copy_bytes` is > > implemented via `dd ibs=1 count="$1"`, which copies data one byte at a > > time. So as we write 1GB of data, we end up doing 1 billion reads and > > writes. This naturally takes a while: it takes 6 minutes on my system, > > and around 40 minutes in some CI jobs! > > > > We can do much better though, as genzeros already knows to handle an > > optional limit of how much data it is supposed to write, which allows us > > to remove the call to `test_copy_bytes`. Furthermore, it has already > > been optimized to generate the data fast. > > Seems like a good fix for this case, where we can skip the extra process > entirely. > > It feels like test_copy_bytes should be able to do much better in > general. The obvious thing to reach for is "head -c", but the function > was originally added because that wasn't portable. The "-c" option is > not in POSIX, though the original comment claims IRIX was the problem, > so I wonder if "head -c" is de facto portable these days. An alternative could be to implement a simple helper as part of our test-tool. But I doubt it's really worth it: almost all callers only want to copy a small number of bytes. The only exception seems to be t0021, where we copy up to 65kB. But that whole test suite still only takes ~3 seconds, so optimizing that feels like wasted time to me. Patrick