select() timeouts on large installations

Cornelia Huck cornelia.huck at gmail.com
Wed Aug 24 06:21:32 PDT 2005


2005/8/23, David Zeuthen <david at fubar.dk>:

> I'd turn on verbose logging and redirect stderr to a file to see what is
> taking so long. Assuming we're CPU bound, profiling may help too, e.g.
> what functions are we spending time in..

hal_device_store_match_key_value_string() as called from
hotplug_event_begin_sysfs() seems to be one of the main culprits. It'll
take longer and longer towards the end of device detection (no wonder,
since more and more devices have been added). Since it is also called
for devices that won't show up in the end, it is called more than double
than the amount of devices we end up with on s390 boxen (since we don't
add subchannels).

> 
> Btw, noone tried optimizing this before... there should be some
> low-hanging fruit... For instance looking up a property is O(n) and it
> could *easily* be made O(1) using e.g. GHashTable...

Sounds like a good idea and should really help in this case. Maybe
a hash table for all known devices would also help to speed up finding
devices?

I'll see if I can hack something together...

Regards,
Cornelia


More information about the hal mailing list