Messages in this thread | | | Date | Thu, 26 Jan 2012 17:18:00 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH v2] proc: speedup /proc/stat handling |
| |
On Fri, 27 Jan 2012 10:09:33 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > I expect most of these numbers are zero. I wonder if we would get > > useful speedups from > > > > for_each_irq_nr(j) { > > /* Apologetic comment goes here */ > > if (kstat_irqs(j)) > > seq_printf(p, " %u", kstat_irqs(j)); > > else > > seq_puts(p, " 0"); > > } > > Yes. This is very good optimization and shows much optimization. > I did this at first try but did complicated ones because it seems > not interesting. (This is my bad habit...) > > I'll try again and measure time.
seq_puts() is too slow ;) I bet seq_putc(p, ' ');seq_putc(p, '0') will complete in negative time.
| |