[PATCH] speed up mapping of pnp_ids to description

Danny Kukawka danny.kukawka at web.de
Fri Sep 1 12:40:35 PDT 2006


Hi,

this patch replace the current linear search for map a pnp-id to description 
with a binary search by using bsearch(). This should reduce the needed 
time/iterations from O(n) (in average O(N/2)) to  O(log n) to find the id 
(from ~400 ids in the list atm).

With this patch I added also some new ids to the list.

Please review.

Danny

 ids.c |  801 +++++++++++++++++++++++++++++-----------------------------
 1 file changed, 412 insertions(+), 389 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-performance-search_pnp_ids.diff
Type: text/x-diff
Size: 37530 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20060901/31311146/hal-performance-search_pnp_ids-0001.bin


More information about the hal mailing list