🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #2643

Re: [PATCH 2/3] t: add "test-tool genbytes" to avoid slow tr(1) on macOS

#2643
From: Johannes Sixt
Date: Sun, 08 Nov 2026 09:35
30 lines
8395 bytes
Am 08.11.26 um 10:18 schrieb Kristofer Karlsson:
> On Sun, 8 Nov 2026 at 09:54, Johannes Sixt <j6t@kdbg.org> wrote:
>>         printf 000000000%0.2147483640d 0
> 
> It is definitely fast enough (on the variants I tested).
> The annoying thing (but not a real blocker) is the extra memory
> usage required and I am not sure I fully trust that all
> implementations will behave the same for absurdly large padding.
> 
> (Particularly for paddings larger than 2^31, as you noted too.)

I don't know how to measure memory requirements, but if it helps,

	printf 000000000%02147483640d 0

(without the fullstop) works, too.

> It feels a bit like a hack, and tweaking the existing test-tool
> feels like a more sane option that is easier to reason about.
> 
> A gotcha here is that the printf hack only works for producing
> "0", so for the cases we truly need NUL characters it does not
> help us, and I think that is also a point in favor of
> simply generalizing test-tool genzeros instead.
On the other hand, the only case you really care about is the one that
takes an insane amount of time. If you convert only that case to printf,
then we do not need all this churn in the first place.

-- Hannes
Technical Details
Message-ID: <6992b7e9-8721-4e1f-9c00-9fd0e0704e80@kdbg.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74827-linux-kernel-git=dewy.ru
References: <pull.2301.git.1794063565.gitgitgadget@gmail.com> <4c02ada9b85028f26f7e7bcc62e2ac12443da9c5.1794063565.git.gitgitgadget@gmail.com> <50b6c35f-e9c3-47ef-8fca-aebd2620623a@kdbg.org> <CAL71e4NFyAShDZPW9JRB7Bpg3aLY5mY4wdn5m_ZYoLQjHZw_jA@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74827-linux-kernel-git=dewy.ru
From: j6t@kdbg.org (Johannes Sixt)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH 2/3] t: add "test-tool genbytes" to avoid slow tr(1) on
 macOS
Date: Sun, 8 Nov 2026 10:35:15 +0100
Organization: Usenet Network
Message-ID: <6992b7e9-8721-4e1f-9c00-9fd0e0704e80@kdbg.org>
References: <pull.2301.git.1794063565.gitgitgadget@gmail.com>
 <4c02ada9b85028f26f7e7bcc62e2ac12443da9c5.1794063565.git.gitgitgadget@gmail.com>
 <50b6c35f-e9c3-47ef-8fca-aebd2620623a@kdbg.org>
 <CAL71e4NFyAShDZPW9JRB7Bpg3aLY5mY4wdn5m_ZYoLQjHZw_jA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="99070"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jWFEphaxt48OYG/287YgFKzq7j4= sha256:pMH+NsPOyje5jz0nR5qTRt8KGBZ8NakHvazd8CsN/U0=
	sha1:pFuPk3lB22dXvQntuqiPJVzzbtM= sha256:bfoSGAeLVm8raQPEpp0sLYdi99uJwGVos0HrILzlySw=
Content-Language: en-US
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id CC84311353E; Sun,  8 Nov 2026 12:35:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 8NVCg0w28VX9;
	Sun,  8 Nov 2026 12:35:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-74827-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=kdbg.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C4625113525; Sun,  8 Nov 2026 12:35:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id AA81432606; Sun,  8 Nov 2026 09:35:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794130526;
	b=ypyp9QLpKqtLf5jPbvtQ/QW/odDseWsZc4po0n8/wlzWlm/oS4HdPRhVWNrnuP6d9Xed
	 dcZfh7nxET8Tu/VtTwql+1BZjrsFzojJr053E6kzy7ttPQJOBH2XxBUwRNzGsYKKno/uJ
	 /3XNR+33D7TfbmoSN6gK/JOKRkpHnsSVZP6WT37+lsSl+QPpBSwv7rYnvaHhWkYvCIau6
	 Kid+oK/hGUiDU+4Xo8XRwWQQPgCtSk0OIbGxGRN0JhUWYBKJe6DH/E2uKQh/+FxHHEntP
	 lmTU+9/iZcICiCMXRBCHNdkisGHWNycpY3E275f+xKBloMaP9BmY3HGPfKK+iQbK6lw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794130526;
	h=X-Original-To:Received:DMARC-Filter:Received:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=XREdQlf2wSZlD8z9ac53SB+AamIf7hLleVc/xrt3n0E=;
	b=rM3tlrpgR4F3ArRCP/t4Fwdv2D859L9dT33BB9pkYLHrwIPIMX+AcH1Ofa3LeQPCD+l7
	 tJE/xf8IAbQ4W312qC/YU1BG7Ix3Jhn4CABmj6/i5vp5xKxlwIOtcWAbMmhQPAwfgrUqG
	 hR4LQpxdJNFSoiQo/MoiVoavGdK7dy1HrhMTqMoHEOxcn2yqDusDhfRAemTa4t2cEx6Kr
	 NcrF4SwHT2OdllNkEY7Jo0vMUDGk1k/Xnhx252NNc5FDplsxQxRA8W/Y9IaG+SE8Cm+jz
	 DIjeV0dUMVNB0Bcu78trOjNzeIhXw4uNovO3ElqaqtBfhZ1Hp+xs4MXZYMElpYbUYpw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=kdbg.org;
	spf=pass smtp.mailfrom=kdbg.org;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D626606A32A;
	Sun,  8 Nov 2026 09:35:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.33.87.15
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794130525;
	b=whOURg/2Zw7OtfgHOGHlsggSq67HTZSt0NOK4DHzHkAK41Bm/FpX8SRvKYDafYuxpu35
	 fhk3xNIre4VDP8j2E6eN88azTRXUbQrbpovocgXV2XI8X0KvaBsBEzg3LubXEHJmnj0pb
	 ++M4VpgNUOgR5+Q7U0/xatFVAJQzg830rgAMRDgdM7AbtTs/LAib6Osk4WlhJnmNNgYqm
	 tQw/2V+s5jkbI6rQkCTlxLAxzZRfYwY8DAIT7AixqRCT7FKi/VRtT0M1KTZrce1Du+Hha
	 vefd1TQ8zjC+PKTuJrgeoUKYCdiDdUVDHOrs46w/aMpwnEY0A7rHwrtF+TkxAIRX24g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794130525;
	h=DMARC-Filter:Received:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=XREdQlf2wSZlD8z9ac53SB+AamIf7hLleVc/xrt3n0E=;
	b=0kOLI0GwR9i5yT3tE07F8AJUp5y1Hlcnm/ZsVN9JmqONZ9gK/yHfcS1++7LFhpnOxC1W
	 5cfJxB2SrUm9yNYu0d+06cIao/3oK97Jg0bLdK+TNmnDJQDfwU+SxnJOeghF4apmnWDsR
	 DZho9CZ6nAsICaV9HpRm3z+NMHYEY3iPBj1oid5+kw5wXXitSJcVlhZaxdOXwoO8lB2vj
	 vftvbSoo916RndLpSVW2usCL+tRGagvLbnSHoAvikQHhzijkRagRtvad9Qv155UHIP8wC
	 SR+JQRcwrEaE0lg/d3C63UvZ8XEz08fAV6ve8pLDMQqDFMbym/30QFPxHS4chYv0f0g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=kdbg.org;
	spf=pass smtp.mailfrom=kdbg.org;
	arc=none smtp.remote-ip=213.33.87.15
X-Received: from bsmtp1.bon.at (bsmtp1.bon.at [213.33.87.15])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 395B6606A31C
	for <git@vger.kernel.org>; Sun,  8 Nov 2026 09:35:25 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 395B6606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kdbg.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kdbg.org
X-Received: from [192.168.0.102] (unknown [93.83.142.38])
	by bsmtp1.bon.at (Postfix) with ESMTPSA id 4jMnnv3sZ5zRnlW;
	Sun,  8 Nov 2026 10:35:15 +0100 (CET)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: Patrick Steinhardt <ps@pks.im>, git@vger.kernel.org,
 Kristofer Karlsson via GitGitGadget <gitgitgadget@gmail.com>
X-In-Reply-To: <CAL71e4NFyAShDZPW9JRB7Bpg3aLY5mY4wdn5m_ZYoLQjHZw_jA@mail.gmail.com>