[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYebFp495HrbbDbZ@1wt.eu>
Date: Sat, 7 Feb 2026 21:05:42 +0100
From: Willy Tarreau <w@....eu>
To: david.laight.linux@...il.com
Cc: Thomas Weißschuh <linux@...ssschuh.net>,
linux-kernel@...r.kernel.org, Cheng Li <lechain@...il.com>
Subject: Re: [PATCH v2 next 05/11] tools/nolibc/printf: Simplify
__nolibc_printf()
On Fri, Feb 06, 2026 at 07:11:15PM +0000, david.laight.linux@...il.com wrote:
> From: David Laight <david.laight.linux@...il.com>
>
> 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
Powered by blists - more mailing lists