?????: modprobe woes
Timo Teräs
timo.teras at iki.fi
Wed Aug 6 09:56:01 UTC 2008
Denys Vlasenko wrote:
> On Wed, Aug 6, 2008 at 8:51 AM, Timo Teräs <timo.teras at iki.fi> wrote:
>> Timo Teräs wrote:
>> So the profile of modprobe-small with module.dep.bb created:
>> ~ # time ./busybox-vladimir modprobe aes
>> real 0m 0.07s
>> user 0m 0.06s
>> sys 0m 0.01s
>>
>> Profile with debug symbols:
>> 21,236,623 PROGRAM TOTALS
>> 13,056,719 get_line_from_file.c:bb_get_chunk_from_file [/root/busybox-vladimir]
>
> This routine uses fgetc in a loop. I just want to remind again -
> if you speed it up, do run full testsuite and fix regressions...
I don't think is too problematic speed. It gives 0.05s invocations or so.
As long as fgets() or fgetc() is used, it's bound to be slower then token
based parsing. That's the only way to reduce total instruction and memory
accesses as the same data needs to be accessed less times.
>> 1,280,482 ???:malloc [/lib/libuClibc-0.9.28.so]
I think this is bigger problem. The profile here does not tell the whole
truth as it does not count kernel time consumed. Calling malloc() makes
brk() kernel calls which slow things down.
If you compare with profile from module-init-tools, it has:
11,620,539 ???:0x00001591 [/sbin/modprobe]
which is the corresponding getline_wrapped() thingy. Time it uses for
reading lines is almost the same (and I guess it's only smaller because
it probably reads a bit less data then the modprobe-vladimir).
Anyway, I don't think there is too big performance problem in either
modprobe-vladimir or module-init-tools. It's the bb-modprobe-vanilla that
has bad performance.
And this was only half of the issue. The other half is that aliases are
not handled correctly in neither modprobe-vanilla nor modprobe-vladimir.
Enough said, I'll just start coding. Assuming I'm worth my words, I'll
post patches and hard numbers later.
Cheers,
Timo
More information about the busybox
mailing list