From: Joe Perches <joe@perches.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] seq_file: delete small-value optimization
Date: Wed, 17 May 2017 16:25:01 -0700 [thread overview]
Message-ID: <1495063501.31562.26.camel@perches.com> (raw)
In-Reply-To: <20170517103341.GB28488@avx2>
On Wed, 2017-05-17 at 13:33 +0300, Alexey Dobriyan wrote:
> > Joe Perches wrote:
> >
> > On Tue, 2017-05-16 at 23:42 +0300, Alexey Dobriyan wrote:
> > > num_to_str() optimizes printing small integers [0..9], so the same
> > > check higher in callchain is unnecessary.
> >
> > Doesn't the optimization exists for the frequent use of 0
> > in seq output?
> >
> > These seq_put_decimal calls are now slightly more expensive.
>
> That additional CALL instruction is hardly measurable so you're adding
> branch to skip branch in the next function.
It's not the call instruction.
num_to_str pushes the value first to stack
and then sets up a loop to copy those chars
to buffer.
The current code immediately pushes to buffer.
It's a fair amount of overhead.
Have you measured it?
next prev parent reply other threads:[~2017-05-17 23:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 10:33 [PATCH] seq_file: delete small-value optimization Alexey Dobriyan
2017-05-17 23:25 ` Joe Perches [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-05-16 20:42 Alexey Dobriyan
2017-05-17 7:11 ` Joe Perches
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=1495063501.31562.26.camel@perches.com \
--to=joe@perches.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.