From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:35616 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbfAGQOq (ORCPT ); Mon, 7 Jan 2019 11:14:46 -0500 Date: Mon, 7 Jan 2019 08:14:42 -0800 From: Matthew Wilcox To: Waiman Long Cc: Andrew Morton , Alexey Dobriyan , Luis Chamberlain , Kees Cook , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, Davidlohr Bueso , Miklos Szeredi , Daniel Colascione , Dave Chinner , Randy Dunlap Subject: Re: [PATCH 2/2] /proc/stat: Add sysctl parameter to control irq counts latency Message-ID: <20190107161442.GZ6310@bombadil.infradead.org> References: <1546873978-27797-1-git-send-email-longman@redhat.com> <1546873978-27797-3-git-send-email-longman@redhat.com> <20190107155840.GY6310@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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?