[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZUKBa0iTH6YBIPS_@alley>
Date: Wed, 1 Nov 2023 17:48:43 +0100
From: Petr Mladek <pmladek@...e.com>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vsprintf: uninline simple_strntoull(), reorder arguments
On Fri 2023-10-27 17:13:58, Alexey Dobriyan wrote:
> * uninline simple_strntoull(),
> gcc overinlines and this function is not performance critical
>
> * reorder arguments, so that appending INT_MAX as 4th argument
> generates very efficient tail call
>
> Space savings:
>
> add/remove: 1/0 grow/shrink: 0/3 up/down: 27/-179 (-152)
> Function old new delta
> simple_strntoll - 27 +27
> simple_strtoull 15 10 -5
> simple_strtoll 41 7 -34
> vsscanf 1930 1790 -140
>
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
I am usually quite skeptical about these micro-optimizations. They might
help only on some architectures with some compiler versions. And
they might make it worse for others.
Well, I could imagine that passing constant via the last parameter
might help in most cases. And the new ordering of the parameters
is fine. So let's get it in.
Reviewed-by: Petr Mladek <pmladek@...e.com>
I have just pushed the patch into printk/linux.git, branch for-6.7.
Best Regards,
Petr
Powered by blists - more mailing lists