Interesting results for getservbyname() performance (and possible changes for /etc/services)

Phil Knirsch pknirsch at redhat.com
Fri Jan 13 09:21:48 UTC 2006


Callum Lerwick wrote:
> Err, how often are service lookups done? How performance critical is
> this, really? Seems to me an application doing a large number of lookups
> is best off just slurping in /etc/services itself (Or just keep its own
> service list) and building its own hash table in RAM or whatnot. (Which
> IIRC is what stuff like nmap and ethereal do...)
> 
> Benchmark a real application first, then optimize. ;P
> 

Well, if you would have read my original post you'd have found the 
following paragraph in it:

Another thing that might be worth looking into is to run some analysis 
what services are most often requested on standard everyday machines and 
maybe move them more to the front so they get read and parsed earlier.

:P

And doing those first few checks i did was important as with that 
information i can now optimize the common case a lot better as soon as i 
have run some real life tests on some workstations and servers here. And 
i can do that optimization application independent. If some application 
needs/wants to work with large portions of /etc/services repeatedly of 
course it needs to be optimized, but that won't help the hundreds of 
other applications, maybe even closed source ones.

Read ya, Phil

-- 
Philipp Knirsch      | Tel.:  +49-711-96437-470
Development          | Fax.:  +49-711-96437-111
Red Hat GmbH         | Email: Phil Knirsch <phil at redhat.de>
Hauptstaetterstr. 58 | Web:   http://www.redhat.de/
D-70178 Stuttgart
Motd:  You're only jealous cos the little penguins are talking to me.




More information about the fedora-devel-list mailing list