Results 1 to 15 of 15
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find something in the registry (Win98)

    I'm a bit perplexed why searching some key or value in the registry takes so long (several minutes as compared to Word's seconds in a file of comparable size).

    Also, often I have the registry key already, and it takes ages to locate it by expanding the folders.
    It would e much easier to copy the key into the find dialog (say, HKEY_LOCAL_MACHINESoftwareMicrosoftOffice9.0Word).
    But if I try that, nothing is found.

    What am I missing? Or is it just a hare-brained implementation?

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    Klaus,

    If you have the full path to the key, HKEY_LOCAL_MACHINESoftwareMicrosoftOffice9.0Word, RegEdit doesn't find it because that full string is not in the registry.

    The individual seciotns HKEY_LOCAL_MACHINE, Software, Microsoft, Office, 9.0, Word will be found individually.

    It's kind of like trying to using Windows Find expecting to open a folder by searching for a path as a file name, if that makes any sense.

    As to why the find is so slow, I have no idea, but it bugs me too.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find something in the registry (Win98)

    I suspect that searching the entire registry is slow because it is a HUGE very deep tree structure, and it is actually searched twice.
    The main root keys HKEY_CLASSES_ROOT and HKEY_CURRENT_USER are actually aliases for HKEY_LOCAL_MACHINESoftwareClasses and HKEY_USERSyour identity.

    If you start searching at the top, you start with the HKEY_CLASSES_ROOT alias, which contains oodles of information on all registered extensions, applications, objects etc. It has an enormous number of entries.

    If you are trying to find something in HKEY_CURRENT_USER, it's better to start there. And if you want to find something in HKEY_LOCAL_MACHINESoftware, start below HKEY_LOCAL_MACHINESoftwareClasses, if possible.

  4. #4
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    > It's kind of like trying to using Windows Find expecting to open a folder by searching for a path as a file name, if that makes any sense.

    I think you are right, and Regedit is missing an Explorer (or browser URL) type box to paste the complete path.

    Maybe the next Windows version will have it (since it seems that MS is moving everything, folder structure and registry alike, to XML).

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    > I suspect that searching the entire registry is slow because it is a HUGE very deep tree structure

    I've not studied computer science, but I thought usually you have a deep tree structure to speed up locating things, not slowing it down <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  6. #6
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    It does speed things up if you are using the Registry access API to go to a specific key. It eliminates reading through all of the records to find the one that you want. However, if you are searching for a string where ever it happens to exist in the registry, that is going to be slow.
    Legare Coleman

  7. #7
    5 Star Lounger
    Join Date
    Dec 2002
    Location
    Perth, Western Australia, Australia
    Posts
    730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    I may be corrected on this
    <font face="Comic Sans MS" color="blue">TimOz</font>
    <img src=/S/flags/Finland.gif border=0 alt=Finland width=30 height=18> <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  8. #8
    Uranium Lounger
    Join Date
    Mar 2001
    Location
    New Jersey
    Posts
    6,684
    Thanks
    1
    Thanked 11 Times in 11 Posts

    Re: Find something in the registry (Win98)

    Apparently Micro$oft thought it was a "hare-brained implimentation" as well. In Windows 2000 & XP there is a Favorites menu in the Registry Editor...

    From PC Magizine
    "Use the Registry Favorites Menu
    If you repeatedly tweak the same keys in the Registry, use the Registry's Favorites menu. Choose Favorites | Add To Favorites. The next time you need to edit the key, open the Registry Editor, select Favorites, and pick from the list."

    If you wait long enough Microsoft will issue a patch for everything... <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23> they just call it a new OS and sell it to you to pay their R&D costs !!! <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15>
    <IMG SRC=http://www.wopr.com/w3tuserpics/DocWatson_sig.gif>

  9. #9
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    Ok, I know I should upgrade <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

    But a browser/Explorer like interface where you can paste your key would be nice to have.

    And though all your comments about traversing the tree (thanks to everybody!) are plausible, I still think it must be bad programming if the performance degrades so much that I can drink lots of coffee (or <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>) while searching the registry.

    After all, VBA (an interpreted language) and Word (which has to worry about lots of formatting) find some string in a flat file of comparable size in no time flat.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  10. #10
    5 Star Lounger
    Join Date
    Dec 2002
    Location
    Perth, Western Australia, Australia
    Posts
    730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    MS might be guilty of one or two instances of bad programming <img src=/S/wink.gif border=0 alt=wink width=15 height=15>, but in this case they' should be innocent <img src=/S/shocked.gif border=0 alt=shocked width=15 height=15>. It's just the nature of the beast.

    My (limited) understanding is that the registry is primarily designed and optimised for fast direct key access by programs. Our manual access to the registry is more an accommodation of a necessary evil. This secondary access could be improved with extra indeces, but their maintenance would presumably impact adversely on the primary function. That is, we could have faster access to the contents of the registry, but would pay for it with a system performance penalty.

    Maybe you could compare it all to how the <img src=/S/snail.gif border=0 alt=snail width=21 height=17>mail system works. The humble postie does his delivery (direct access) promptly anywhere in the world when given fully addressed mail.

    Now imagine giving him an envelope with just the name "Fred Nerk", without an address. Being a dedicated postie, he goes looking (manual access) for Fred
    <font face="Comic Sans MS" color="blue">TimOz</font>
    <img src=/S/flags/Finland.gif border=0 alt=Finland width=30 height=18> <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  11. #11
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    Now, I have to admit I'm a physicist by education, and used to order-of-magnitude estimates. Let's say the registry contains on the order of 100.000 nodes (to take a high estimate).

    With a GHz processor, you could spend on the order of 10.000 instructions on each node each second.

    If it still takes more than a minute (= 1.000.000 instructions per node) to traverse the tree and compare each entry with the search text, I have to assume it could be handled much faster.


    I don't completely follow your reasoning because you compare traversing the whole tree, and following the branches to some address directly via an index (direct addressing).
    Of course the latter takes pretty much no time at all, compared to the former.

    My argument was that traversing the tree should not be *that terribly* much slower than searching in a flat file.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  12. #12
    5 Star Lounger
    Join Date
    Dec 2002
    Location
    Perth, Western Australia, Australia
    Posts
    730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    Any programmers reading this, probably shouldn't. <img src=/S/stop.gif border=0 alt=stop width=26 height=24> Sanity and continence are both at risk.

    The ice is getting thinner and the water deeper by the second. But I'll keep on digging this hole that I'm in, while merrily mixing metaphors. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Essentially the registry is a hierarchical tree structure of keys, subkeys and value entries. Each key can contain subkeys and value entries. To access a specific value, you need its key name and value entry name, for an instruction like:

    get key name, value entry name

    But, to search for a specific value is more complex, since the key and value entry names are unknown. You need to check each key and value entry. To do so, you need their names. The start is from the only known entry, the root. So, for each key the instructions would be something like:

    get the value entry names contained in the key
    create an indexed table for value entry names in the key
    store each value entry name in the indexed table
    for each value entry name in the table
    get the value entry
    compare the value to the search value
    get the subkey names contained in the key
    create an indexed table for subkey names in the key
    store each subkey name in the indexed table
    for each subkey name in the table
    reenter this process

    I'm unsure how deeply subkeys are nested on average, but up to 10 layers seems common. This process becomes increasingly inefficient the deeper you go. Processing overhead is incurred just to track the progress through the tree structure.

    An alternative would be to hold only the minimum information to track your position within the tree. It would eliminate the overhead to maintain the nested tables and their indeces. That would speed up dropping down through the tree. But there would be a penalty to go sideways, or back up the tree, to repeatedly get the information discarded earlier.

    Either way, a search of a flat file structure should be trivial by comparison:

    get next value entry
    compare the value to the search value
    repeat until eof

    While the differences in the pseudocode instructions aren't directly related to execution times, they seem sufficient to explain a significant difference in search times between the two data structures. The instructions to search a tree structure are roughly ten times those needed for a flat file. The difference could increase another ten times in executable binaries, given the more complex instructions needed for the tree structure.

    BTW those "order-of-magnitude" estimates may be in the ballpark. <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15> My 2.4gHz P4 with 512mb searches a 24mb registry in under 20 seconds. A search of the smaller registry on my old 500mHz P3 with 128mb used to be a "grab a brew" exercise of several minutes. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    <font face="Comic Sans MS" color="blue">TimOz</font>
    <img src=/S/flags/Finland.gif border=0 alt=Finland width=30 height=18> <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  13. #13
    5 Star Lounger
    Join Date
    Dec 2002
    Location
    Perth, Western Australia, Australia
    Posts
    730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    As an aside, I forgot about a product that does rip thru the registry much faster than regedit. It cut my 20sec search down to a few seconds (and told me I've got 88,000+ keys). It's mentioned in <!post=Re: Win 98 ,225650 >Re: Win 98 <!/post>, if you're interested.

    I'm unsure how the fast search is done. But they do "integrate" with regedit to modify the registry (and thus maintain the tree structure).
    <font face="Comic Sans MS" color="blue">TimOz</font>
    <img src=/S/flags/Finland.gif border=0 alt=Finland width=30 height=18> <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  14. #14
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    Thank you once more for your detailed analysis, and for the link to the "Registry Crawler".
    A funny name -- <img src=/S/snail.gif border=0 alt=snail width=21 height=17> If it really speeds up searching the Registry five times, that feature alone may well be worth 40$.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  15. #15
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find something in the registry (Win98)

    For free registry searching and control, I like Registrar Lite. Also, if you have Norton Utilities, they used to make a Norton RegEdit that was better at searching.

    My biggest gripe about the basic RegEdit is that it finds ONE item at a time. The above two programs give you all the findings at once.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •