T
Twayne
Registry Use:
I decided to take a look at just what kind of things were in the
registry with respect to installed programs. We already know there are
huge number of entries for the operating system, but how about programs?
So I got out my handy-dandy registry lister tool and the first thing I
counted was a non-MS app, WinZip since many people use it these days.
The counts are as follows:
Keys: 56 4 hives
Values: 52 HK CU, LM, _users
Data: 242 4 hives
-------
Total: 350 registry entries for Winzip.
A VB6 application I wrote and compiled: Only had add/remove entries.
Very little impact on the registry. But that's typical of Vb 6 files.
Their true weight is in the overhead that the operating system carries
with it every day of its life so the counts are low. IMO it makes sense
to not add several frameworks etc. when the os already provides almost
everything needed for a new app.
MS Word 2002 on the other hand, has a whopping 2,384 total entries if I
counted accurately, which I cannot guarantee, but it's going to be
pretty close. I shudder to think what some of the other, more powerful
MS apps might have in the registry.
Multiply those numbers for the remaining MS apps and other apps
installed on the machine and you begin to understand why the registry,
even though it's normally only a text file, gets to be so many megabytes
large.
My current total registry size is about 145 MB and takes about 30
seconds to write to the disk. I would then surmise that at least 30+ S
of my boot time is reading the registry since reads/writes are
approximately equal from disk. A defrag of the disk might change that
time, but that's what it is at the moment.
145 MB is a lot of text. It explains why Regedit can take so long to
find a key or value, too. And why a program can get around the registry
a lot faster than opening it in redegit and doing the changes manually,
especially when you consider that a "change" in the registry may involve
the edit/revision of many, many entries.
Regedit does not "go directly" to any specific location in the registry;
it has to read it into a section of RAM and then search it sequentially
for the search item requested, from top to bottom. It could, actually,
search much faster than it does, but in the typical MS fashion, it does
not. Only the operating system uses the Registry; Regedit does not.
The registry is a "sort of" database, but it doesn't have an actual
"index" as most understand "index". It's index is simply a table it
searches and then tables within a table until finally it switches to
sequential mode to find the specific item it's looking for a match on.
The large size of the text file and lack of any kind of crc or hash
control on it is why corruption can happen to it so easily. The registry
is even more exposed to corruption from the operating system glitches,
malware and poorly written apps than some other parts of the system.
Especially when you consider the very large number of times the registry
is written to or read even while a computer is sitting idle.
How much does the registry actually get used in normal operation?
Well, that's fairly easy to approximate using ntregmon. With all the
filters off, this article, a web page, and one instance of windows
Explorer open, but all idling with the exception of my registry monitor,
we get:
SECONDS WHERE
0.90202265 S elapsed: Regmon.exe:7772
CloseKeyKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2...SUCCESS
1.05899976 S elapsed: spoolsv.exe:1604 OpenKey HKCU... SUCCESS
1.05905522 S elapsed: spoolsv.exe:1604
CreateKeyHKCU\Printers\Dev...SUCCESS
1.05939660 S elapsed: spoolsv.exe:1604 CloseKey HKCU ... SUCCESS
At the 1.05899976 S elapsed: point, there were 2,151 registry accesses
recorded.
At the 10 S elapsed: point, it was 6,251 accesses recorded. I stopped it
at 10 seconds since more time would just be more of the same activity.
The registry is a very busy place! Technically I probably should have
filtered ntregmon from the counts but I forgot to. Even so it would
still leave large numbers of accesses, especially when extended to a
minute, or hour, or day. These accesses are more or less the ONLY
"direct" access to any part of the registry, and they are being done by
the operating system. I don't know of any good apps that can access the
registry as the OS does or even similarly; I wish I did; so I've nothing
to recommend there.
You can easily duplicate my test here with the free tool ntregmon,
available from many places on the 'net. The copy I just used comes from
Microsoft's Sysinternals section but it's no different than the old one
from SysInternals before the purchase. So far at least. And it's free,
of course. It CAN be a very useful program for those who take the time
to learn its abilities, else it's just an interesting "thing" and not
much real use.
Twayne
I decided to take a look at just what kind of things were in the
registry with respect to installed programs. We already know there are
huge number of entries for the operating system, but how about programs?
So I got out my handy-dandy registry lister tool and the first thing I
counted was a non-MS app, WinZip since many people use it these days.
The counts are as follows:
Keys: 56 4 hives
Values: 52 HK CU, LM, _users
Data: 242 4 hives
-------
Total: 350 registry entries for Winzip.
A VB6 application I wrote and compiled: Only had add/remove entries.
Very little impact on the registry. But that's typical of Vb 6 files.
Their true weight is in the overhead that the operating system carries
with it every day of its life so the counts are low. IMO it makes sense
to not add several frameworks etc. when the os already provides almost
everything needed for a new app.
MS Word 2002 on the other hand, has a whopping 2,384 total entries if I
counted accurately, which I cannot guarantee, but it's going to be
pretty close. I shudder to think what some of the other, more powerful
MS apps might have in the registry.
Multiply those numbers for the remaining MS apps and other apps
installed on the machine and you begin to understand why the registry,
even though it's normally only a text file, gets to be so many megabytes
large.
My current total registry size is about 145 MB and takes about 30
seconds to write to the disk. I would then surmise that at least 30+ S
of my boot time is reading the registry since reads/writes are
approximately equal from disk. A defrag of the disk might change that
time, but that's what it is at the moment.
145 MB is a lot of text. It explains why Regedit can take so long to
find a key or value, too. And why a program can get around the registry
a lot faster than opening it in redegit and doing the changes manually,
especially when you consider that a "change" in the registry may involve
the edit/revision of many, many entries.
Regedit does not "go directly" to any specific location in the registry;
it has to read it into a section of RAM and then search it sequentially
for the search item requested, from top to bottom. It could, actually,
search much faster than it does, but in the typical MS fashion, it does
not. Only the operating system uses the Registry; Regedit does not.
The registry is a "sort of" database, but it doesn't have an actual
"index" as most understand "index". It's index is simply a table it
searches and then tables within a table until finally it switches to
sequential mode to find the specific item it's looking for a match on.
The large size of the text file and lack of any kind of crc or hash
control on it is why corruption can happen to it so easily. The registry
is even more exposed to corruption from the operating system glitches,
malware and poorly written apps than some other parts of the system.
Especially when you consider the very large number of times the registry
is written to or read even while a computer is sitting idle.
How much does the registry actually get used in normal operation?
Well, that's fairly easy to approximate using ntregmon. With all the
filters off, this article, a web page, and one instance of windows
Explorer open, but all idling with the exception of my registry monitor,
we get:
SECONDS WHERE
0.90202265 S elapsed: Regmon.exe:7772
CloseKeyKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2...SUCCESS
1.05899976 S elapsed: spoolsv.exe:1604 OpenKey HKCU... SUCCESS
1.05905522 S elapsed: spoolsv.exe:1604
CreateKeyHKCU\Printers\Dev...SUCCESS
1.05939660 S elapsed: spoolsv.exe:1604 CloseKey HKCU ... SUCCESS
At the 1.05899976 S elapsed: point, there were 2,151 registry accesses
recorded.
At the 10 S elapsed: point, it was 6,251 accesses recorded. I stopped it
at 10 seconds since more time would just be more of the same activity.
The registry is a very busy place! Technically I probably should have
filtered ntregmon from the counts but I forgot to. Even so it would
still leave large numbers of accesses, especially when extended to a
minute, or hour, or day. These accesses are more or less the ONLY
"direct" access to any part of the registry, and they are being done by
the operating system. I don't know of any good apps that can access the
registry as the OS does or even similarly; I wish I did; so I've nothing
to recommend there.
You can easily duplicate my test here with the free tool ntregmon,
available from many places on the 'net. The copy I just used comes from
Microsoft's Sysinternals section but it's no different than the old one
from SysInternals before the purchase. So far at least. And it's free,
of course. It CAN be a very useful program for those who take the time
to learn its abilities, else it's just an interesting "thing" and not
much real use.
Twayne