lkml.org 
[lkml]   [2013]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args
On Sat, Mar 16, 2013 at 10:51:18AM -0700, Joe Perches wrote:
> > This is certainly a neat trick.
> >
> > But I don't really like the fact that it complicates things for every
> > future code reader, especially when a trivial change in the caller
> > would accomplish the same thing. Do you have any idea how much
> > performance we would gain in exchange for the complication?
>
> Nope. I believe it's trivial in any case.
> I just saw Steven's trace hack and thought of seq_printk.
>
> Is there a real performance sensitive seq_printf anywhere?

... and _that_ is the question that should've been asked first.

> It's trivial to replace seq_printf("constant") with
> seq_puts but there are over a thousand of them.
>
> It may be better to just leave everything as-is.

Quite. Note that it's not equivalent to gcc treatment of printf/puts -
there we have cases when it *is* a real hotpath (and I seriously suspect
that it's in part driven by desire to discourage people from uglifying
source by manual equivalents of that micro-optimization). Moreover,
glibc printf at least used to be heavy; kernel-side we are nowhere near
that bad.


\
 
 \ /
  Last update: 2013-03-16 19:21    [W:0.049 / U:2.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site