On Sunday 19 June 2011 21:26, Timo Teräs wrote: > On 06/19/2011 02:08 PM, Denys Vlasenko wrote: > > 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? > > For busybox, I have make allyesconfig, except FORCE_MMU disabled, and > "disable optimizations" was disabled so I got -O2. Some other minor > things that caused compile problems. > > Kernel is standard Ubuntu -generic.
I don't have Ubuntu. Can you tell me the size of the file? > > 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)? > > Your patch doesn't work. You probably meant #ifdef *_unlocked. But that > doesn't work either as those are functions, not #defines. I did try just > one line change in parse_config.c changing getch to _unlocked. Does not work in which way? (and yes, I meant ifNdef). I pushed it to git, btw... > As suggested by Rich, unlocked is a speed up, but not as major as > getline. And both, hashing and getline give a considerable speed up here. Applied both to git. Thanks! > Tests run on moderate laptop (Core2 Duo T7300, 2*4000 bogomips), running > Linux Mint (= glibc). Against standard kernel modules.dep which is 300kB > or 3075 lines. getline speed-up on uclibc is not probably as large, > since uclibc getline is lame and needs performance optimization as > noticed before. Actually, same applies to also fgets/gets in uclibc. All > the line readers suck there as they use getc_unlocked() loop instead of > doing memchr on the buffer. I bet Bernhard will be happy :) > Thinking also more, if using fgets instead of getline, the resulting > code might be slightly smaller in size. As the getline implementation > needs two line buffers for the continuation handling. Most lines in config files don't have continuation. -- vda _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
