From: "H. Peter Anvin" <hpa@linux.intel.com>
To: Jean Sacren <sakiwit@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] boot: Enhance performance by eliminating unnecessary calls to printf()
Date: Mon, 06 Jun 2011 10:08:32 -0700 [thread overview]
Message-ID: <4DED0990.8090309@linux.intel.com> (raw)
In-Reply-To: <20110606004038.GA28970@mail.gmail.com>
On 06/05/2011 05:40 PM, Jean Sacren wrote:
> Hi,
>
> Repeated calling to printf() for 13 times is a dire waste of CPU cycles.
> For performance, combine all those calls into one while source code
> formatting is preserved for readability.
>
> Compile tested only.
>
> Signed-off-by: Jean Sacren <sakiwit@gmail.com>
You're got to be bloody kidding.
First of all, this is a build time tool which is executed exactly once
during the entire kernel build.
Second, printf execution time is largely dependent on the size
formatting string; since the I/O is buffered it is only issued once
anyway... which basically means that there is no time saved at all.
Third, the resulting code is substantially harder to read.
Fourth, carrying this as a patch will cost kernel developers more time
in additional git execution time than it ever will save them in build time.
Nacked-by: H. Peter Anvin <hpa@zytor.com>
-hpa
next prev parent reply other threads:[~2011-06-06 17:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 0:40 [PATCH 1/1] boot: Enhance performance by eliminating unnecessary calls to printf() Jean Sacren
2011-06-06 17:08 ` H. Peter Anvin [this message]
2011-06-12 18:36 ` Jean Sacren
2011-06-14 18:23 ` Valdis.Kletnieks
2011-06-14 18:58 ` Bryan Donlan
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=4DED0990.8090309@linux.intel.com \
--to=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sakiwit@gmail.com \
/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