Removed sorting of registry key values

Andriy Palamarchuk apa3a at yahoo.com
Wed Apr 3 11:34:20 CST 2002


--- Eric Pouech <eric.pouech at wanadoo.fr> wrote:
> I fail to see the benefits of the patch:
> - key are sorted to allow O(log(n)) searching
> (registry
>   is loaded only once, and then searched lots of
> time)
>   so using enhanced searching techniques (<< O(n))
> is 
>   really needed
> - saying that NT doesn't export the keys in an
>   alphabetical order doesn't mean the keys are not 
>   sorted. So far, you can only tell that they are
> not
>   sorted, in the export mechanism, by an
> alphabetical
>   order. They could be sorted, for example, by a
> hash
>   code value (look at misc/registry.c for some more 
>   details on registry internals)

The tests show that values are exported in the same
order in which they are created. This means the values
are stored not in any particular order. Sure, Windows
internallty can use map of keys for faster search but
I doubt it.

A program can expect to retrieve values in the order
they were created. In particular, the problem can be
if the app creates names like Item1, ..., Item10.
After sorting Item10 will be after Item1, not after
Item9.

I don't have any doubts that existing code is faster.
The point of the patch is compatibility with Windows
behaviour.

Andriy Palamarchuk

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/



More information about the wine-devel mailing list