From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.formilux.org (mta1.formilux.org [51.159.59.229]) (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 A10521482E8 for ; Sat, 7 Feb 2026 20:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.159.59.229 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770494745; cv=none; b=BAajquU1XP3aKgoqGejkT4RyN4l35NTzNWTbEbuxo1URZP+eGYbnjtl5PcRy7g42tdEaayeOVKBgexs6G/m+33/tgCWmbaKV3rUjniELxynrkIERrVrffqDcjifaFPL5lWkJcgNrjG7MnzG+PT1MGkYOuS+VBFvwU8NhjW5wclY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770494745; c=relaxed/simple; bh=stVqIY6PL6CVOrShqAmUs6j9x1pzEhgh6rI1CMmfVxE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PBXE49POJqiSmQNfvufDPpV64OKwrC6fOjpisr34d8J9K4ymYMqeIFVEb/5VXVEIeAnrO4APTTY6/ogLgZwGcXRFdKQUwYR1cyctZr6u6tyS5b6Pz4f99Eu1E9zX57Xr+Gw88kyeK+wHqmKOyFpjpMjVkq9VH/L4vMxZkqxwJx0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b=u0gtN2qX; arc=none smtp.client-ip=51.159.59.229 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b="u0gtN2qX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1wt.eu; s=mail; t=1770494742; bh=V6TV2j6yEm8PkZAOlemjS3LkQJERQ+xyWP3ND8PorvQ=; h=From:Message-ID:From; b=u0gtN2qX2d8wW0xc6AhVWyFL29ZSO5Cv+hoBRAIWgMxNdbulnO7jok3n1745LwKji abb0hFF1Q8ktbl3ssTqMUe6h2rqriPwvBBm1IiIzzh7pNgoIE1actwz6G9XOClIZX+ mbwwwWdZ0aeiSedrcO0Vb+QpX6vZEvGr+bLB8NcA= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by mta1.formilux.org (Postfix) with ESMTP id 9DE42C0A3D; Sat, 07 Feb 2026 21:05:42 +0100 (CET) Date: Sat, 7 Feb 2026 21:05:42 +0100 From: Willy Tarreau To: david.laight.linux@gmail.com Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH v2 next 05/11] tools/nolibc/printf: Simplify __nolibc_printf() Message-ID: References: <20260206191121.3602-1-david.laight.linux@gmail.com> <20260206191121.3602-6-david.laight.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20260206191121.3602-6-david.laight.linux@gmail.com> On Fri, Feb 06, 2026 at 07:11:15PM +0000, david.laight.linux@gmail.com wrote: > From: David Laight > > Move the check for the length modifiers into the format processing > between the field width and conversion specifier. > This lets the loop be simplified and a 'fast scan' for a format start > used. > > If an error is detected (eg an invalid conversion specifier) then > copy the invalid format to the output buffer. > > Reduces code size by about 10% on x86-64. I'm surprised, because for me it's the opposite: $ size hello-patch* text data bss dec hex filename 1859 48 24 1931 78b hello-patch1 2071 48 24 2143 85f hello-patch2 2091 48 24 2163 873 hello-patch3 2422 48 24 2494 9be hello-patch4 The whole program grew by almost 16%, and that's a 30% increase since the first patch. This is with gcc 15 -Oz. aarch64 however decreased by 15 bytes since previous patch. I have not figured what makes this change yet, I'm still digging. Willy