lkml.org 
[lkml]   [2022]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 03/33] vsprintf: Convert to printbuf
From
On 15/06/2022 20.44, Kent Overstreet wrote:
> On 6/15/22 05:09, Rasmus Villemoes wrote:

>> Anyway, my main concern with this is that performance goes down the
>> drain and the generated code will be awful. Have you done any
>> measurements and/or looked at disassembly? Thanks to
>> -fno-strict-aliasing (or perhaps just because we're writing through a
>> char* pointer which IIRC may alias anything), I think the compiler will
>> be forced to reload prt->pos and prt->size over and over and over. I may
>> be wrong, of course, that happens often. Perhaps __restrict could
>> help, IDK.
>
> If we care that much about sprintf performance we must have some
> benchmarks somewhere - could you point me at them?

Try 'perf top'. Or copy the meat of vsprintf.c (all the %p gunk can be
elided) and do some measurements in userspace, that's what I did when I
improved the decimal conversion a few years back.

And yes, "we" care about sprintf performance because it's used to
generate all those files in /proc, /sys etc. etc. which many tools (e.g.
top/ps) rely on.

Rasmus

\
 
 \ /
  Last update: 2022-06-17 11:00    [W:1.798 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site