Re: [PATCH 2/2] /proc/stat: Add sysctl parameter to control irq counts latency

From: Matthew Wilcox
Date: Mon Jan 07 2019 - 11:14:49 EST


On Mon, Jan 07, 2019 at 11:07:47AM -0500, Waiman Long wrote:
> > Why are you caching the _output_ of calling sprintf(), rather than caching the
> > values of each interrupt?
> >
> It is just faster to dump the whole string buffer than redoing the
> number formatting each time when the values don't change. I can cache
> the individual sums instead if it is the preferred by most.

But it also consumes more memory. Can you gather some measurements to
find out what the performance difference is if you cache the values
instead of the strings?