[PATCH 0/8] Various large optimisations

Rob Taylor rob.taylor at codethink.co.uk
Mon Nov 19 08:16:54 PST 2007

Here is a sequence of patches that optimise HAL's startup time and
memory usage.

They can be split down into 5 main parts:

 1) Use gslice for HalProperty and HotplugEvent. This gives us better
memory locality for these commonly used structures

 2) Only generate HotplugEvents during coldplug when they are actually
needed, and process them as soon as they are queued. This removes a lot
of the huge (7M on my machine) memory usage on coldplug

 3) Use GQuarks for property names - this gives a modest cut in
footprint and improves locality.

 4) Allow hotplug events to process in parallel. This intruduces into
HAL a similar parallel event processing method as udev. Along with 2),
this removes the coldplug memory peak almost entirely (Cutting down to
350K on my intel hardware and about 150K on an N800)

 5) Add the ability in HalDeviceStore to index given properties by
value. Profiling showed that about 20% of coldplug time was spend in
 hal_device_store_match_key_value_string to look up devices by
sysfs_path. This generic patch cuts each lookup to a couple of hash
table lookups, versus n strcmps.

 Options and feedback most welcome!

 Rob Taylor
Rob Taylor, Codethink Ltd. -  http://codethink.co.uk

More information about the hal mailing list