performance of pci_device_get_{vendor, device}_name() in X server startup

Julien Cristau jcristau at
Tue Jun 8 14:45:04 PDT 2010

On Tue, Jun  8, 2010 at 14:26:32 -0700, Richard Barnette wrote:

> In a recent investigation of system boot time for Chromium OS, I
> discovered that an inordinate amount of time during X server startup
> was going to processing required for pci_device_get_vendor_name() and
> pci_device_get_device_name().  The reason is straightforward:  these
> routines operate by opening a compressed file, and then performing a
> linear search of the decompressed data (more than 600K worth) looking
> for the desired entries.  For concrete numbers:  not looking up the
> names on Chromium OS reference hardware (a netbook based on the Intel
> Pintrail chipset with SSD storage) is worth 400 ms boot time out of a
> 5 second total time budget.
> I'd like fix this with a patch to X upstream, so that the change doesn't
> have to be maintained as part of the Chromium OS sources.  For a first
> cut, I can think of three obvious approaches:
>   * Change xorg-server to simply drop the calls to get the vendor and
>     device names.
>   * A build or configure option in libpciaccess that disables the
> library
>     routines (i.e. forces them to return NULL in all cases).

Can't you already configure libpciaccess with

>   * A runtime option to the X server that allows specifying the path to
>     the "pci.ids.gz" or "pci.ids" file.  Chromium OS could specify /
> dev/null
>     to get the desired time savings.  (This would mean touching both
>     xorg-server and libpciaccess).
> I'd like advice/opinions on which of these might be the most eagerly
> embraced (or at any rate, least vigorously opposed :-) ), or whether
> there's a better idea I've overlooked.
Making these functions faster would seem like the best option, if at all


More information about the xorg-devel mailing list