Em Tuesday 07 October 2008 13:05:44 Dan Nicholson escreveu: > > Whenever you do a getservbyname(), the glibc resolver has to parse out > /etc/services. This happens when you use "http", and the resolver has > to decide what port number to use. Likewise, when some program > specifies "tcp", the glibc resolver has to parse /etc/protocols to > decide what protocol number that corresponds to. So, cutting out the > comments just makes the parsing faster. I saw a discussion of this a > while ago on a fedora list, but I can't find the link now. I follow the thread and found this forums before too.
> > You can test this yourself with getent and then try again with a > stripped down /etc/services (I didn't bother). > > $ time { for ((n = 0; n < 100; n++)); do getent services http > > >/dev/null; done; } > > real 0m0.098s > user 0m0.033s > sys 0m0.065s > > I happen to think the comments are more beneficial than any speedup, > but that's just my preference. > > -- > Dan I load the file on cache before the tests! No Stripped time { for ((n = 0; n < 100; n++)); do getent services http > /dev/null; done } real 0m0.110s user 0m0.024s sys 0m0.084s Stripped time { for ((n = 0; n < 100; n++)); do getent services http > /dev/null; done } real 0m0.106s user 0m0.020s sys 0m0.084s Low difference! :( -- Valter Douglas Lisbôa Jr. Sócio-Diretor Trenix - IT Solutions "Nossas Idéias, suas Soluções!" www.trenix.com.br [EMAIL PROTECTED] -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page