[cups.development] why not hash?

Hidetomo Katsura Hidetomo.Katsura at efi.com
Mon Apr 23 12:52:24 PDT 2007


hi there,

i'm new on this list.

i noticed that cups 1.2+ uses a binary search O(log n) to lookup the option
keyword which is a major improvement from a linear search O(n) on cups 1.1.

can it use a hash table lookup O(1) instead? would cups.org take it if i
write the hash table lookup? what's the process? obviously, i'm not familiar
with open source processes. 

without realizing that 1.2+ added a binary search, i made small changes to
cups from Mac OS X open source to use the hash table lookup
(CFDictionary/CFString), and ppdConflicts() call which calls ppdFindOption()
got 2 times faster. btw, it spends more than 50% of time in ppdFindOption()
while opening the print dialog on Mac OS X.

katsura





More information about the cups mailing list