From: Petr Mladek <pmladek@suse.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vsprintf: uninline simple_strntoull(), reorder arguments
Date: Wed, 1 Nov 2023 17:48:43 +0100 [thread overview]
Message-ID: <ZUKBa0iTH6YBIPS_@alley> (raw)
In-Reply-To: <82a2af6e-9b6c-4a09-89d7-ca90cc1cdad1@p183>
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
prev parent reply other threads:[~2023-11-01 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <82a2af6e-9b6c-4a09-89d7-ca90cc1cdad1@p183>
2023-10-30 8:59 ` Andy Shevchenko
2023-11-01 16:48 ` Petr Mladek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZUKBa0iTH6YBIPS_@alley \
--to=pmladek@suse.com \
--cc=adobriyan@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®