Minimize overhead of getlines_wrapped in modprobe and depmod
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Mon, 13 Oct 2008 05:33:27 +0000 (01:33 -0400)
committerJon Masters <jcm@jonmasters.org>
Mon, 13 Oct 2008 05:33:27 +0000 (01:33 -0400)
commita741c5c6ad0184319ad6f00537893533ca5c5707
tree680739fcaa8ebbb40557acb8aaee3b3b5a502cb5
parent04170aaff08cedcf3a446c2a5d7d350474592bf4
Minimize overhead of getlines_wrapped in modprobe and depmod

A serious amount of time is spent in getlines_wrapped() reading config files.

The biggest gain is switching from fgetc() to getc_unlocked()
Also, squeeze the fast path and reduce the initial buffer allocation.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
depmod.c
modprobe.c