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

Richard Barnette jrbarnette at chromium.org
Tue Jun 8 14:26:32 PDT 2010


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).
   * 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.

Thanks!


(For those of you about to ask "What's Chromium OS?", the details are
at http://www.chromium.org/chromium-os; the short summary is it's an
open-source platform for mobile devices running the Chromium browser
as the sole native application.)

-- jrb



More information about the xorg-devel mailing list