lkml.org 
[lkml]   [2023]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@gmail.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@suse.com>

I have just pushed the patch into printk/linux.git, branch for-6.7.

Best Regards,
Petr

\
 
 \ /
  Last update: 2023-11-01 17:49    [W:0.071 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site