[PATCH 3/3] parse_config: use getline to read config

Denys Vlasenko vda.linux at googlemail.com
Sun Jun 19 11:08:53 UTC 2011


On Sunday 19 June 2011 05:39, Timo Teräs wrote:
> On 06/19/2011 05:54 AM, Denys Vlasenko wrote:
> > On Saturday 18 June 2011 17:56, Timo Teräs wrote:
> >> Speeds up considerably config file parsing.
> >>
> >> Signed-off-by: Timo Teräs <timo.teras at iki.fi>
> > 
> > # time ./z ./busybox_old 2>/dev/null
> > real    0m5.337s
> > user    0m4.655s
> > sys     0m0.393s
> > 
> > # time ./z ./busybox 2>/dev/null
> > real    0m5.150s
> > user    0m4.291s
> > sys     0m0.379s
> > 
> > Again, some win, but it's small. However, I use uclibc configured without threads.
> 
> For both patches 1 and 3.
> 
> The speed up depends on the size of your modules.dep and the amount of
> aliases in /etc/modprobe.d.
> 
> I was testing with stock Ubuntu kernel modules data, and speed up was
> enough to justify the byte addition.

I just tested it again on Fedora 15, which has bigger modules.dep.
(My machine's modules.dep is 41k, F15's is 224k).

On both machines speedup is not so big. Hash seems to help more then getline:
on F15, it reduced run time from 19 to 16 seconds, while getline won
~0.5 sec only.

Don't take me wrong, I'm not saying the patches are not good.
I am saying we need to figure out how much *each* patch speeds up
modprobe, and in what conditions (IOW: why you see big speedup,
and I see small one), so that we can document it in comments
and save some head scratching for future hackers.

Let's take a more detailed look.

How big is your modules.dep (bytes and lines)?

Can you send me your .config?

Can you send me timing results and bloatcheck for both patches?

How much speedup you get if you use getc_unlocked instead of getline
(see attached patch)?

-- 
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9.patch
Type: text/x-diff
Size: 1175 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20110619/2b9472d8/attachment.bin>


More information about the busybox mailing list