Skip to contentSkip to conversation

reading config files with klibc slow

DISCUSSION Olaf Hering 2 participants 3 messages Mar 12, 2004

lore
Share & tools
lore
#0 lore raw

fgets from klibc does a read for each single char, which makes it a bit slow.
Should I fix klibc or change udev to read the config files in bigger chunks?

smirnow:~ # ACTION�d DEVPATH=/block/loop6 strace -ttfo foo /sbin/udev.static block smirnow:~ # ACTION�d DEVPATH=/block/loop6 strace -ttfo bar /sbin/udev block
smirnow:~ # sed '1p;$p;d' foo
19136 17:32:36.351024 execve("/sbin/udev.static", ["/sbin/udev.static", "block"], [/* 50 vars */]) = 0
19136 17:32:40.771209 _exit(0) = ?
smirnow:~ # sed '1p;$p;d' bar
19138 17:32:45.674232 execve("/sbin/udev", ["/sbin/udev", "block"], [/* 50 vars */]) = 0
19138 17:32:45.877024 exit_group(0) = ?

0.2 vs. 4.4 seconds.

Signature · 14 lines
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op�k
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 2 lines · Olaf Hering

fgets from klibc does a read for each single char, which makes it a bit slow.

Yes ,I noticed this too with a strace.

I prefer a klibc change, but you may ask [email protected], maybe hpa has any reason to do it one by one.

thanks,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Olaf Hering
Quoted 8 lines · Kay Sievers
Quoted 2 lines · Olaf Hering

fgets from klibc does a read for each single char, which makes it a bit slow.

Yes ,I noticed this too with a strace.

I prefer a klibc change, but you may ask [email protected], maybe hpa has any reason to do it one by one.

I have looked at the glibc code, and they implement getline in some odd but appearently good performing code.

Signature · 14 lines
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op�k
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel