Sunday, June 23, 2013

Does cleaning Windows Registry actually improve performance?

registryNo, it doesn’t.

If you’re looking for a longer and more detailed explanation, keep reading.

To begin with, Windows Registry, what is it good for? From Wikipedia:

… hierarchical database that stores configuration settings and options on Windows. It contains settings for low-level operating system components and for applications running on the platform that have opted to use the registry. The kernel, device drivers, services, SAM, user interface and third party applications can all make use of the registry. The registry also provides a means to access counters for profiling system performance.

TL, DR: The registry is a compilation of Windows settings and configurations.

So, again, is performance affected by “cleaning” the registry? No, is not. You can modify some keys to improve performance, but “cleaning” will do nothing.

The myth started back in the old days, when Windows was young, modifying the registry was a pretty common practice due to network limitations and PC power; gamers modified TCP ports to improve network connectivity or maintain a stable connection, and PC tweakers will mess with it to improve performance a little (back there, even a little was a lot). But deleting keys does not affect actual performance; most of the time when a key is delete it, the program using it will replace it with the same and with default settings.

When you uninstall a program, the program should delete the keys that were added to the registry when it was installed, but many times this is not the case and the keys remain as invalid ones. These invalid keys won’t affect Windows at all because the program using/accessing them is no longer installed, ergo, they will remain there and just take a few bytes of space. Even if removing them, a few bytes of size are nothing to worry about.

Now, these invalid keys could barely and rarely affect Windows performance, yes. This is because in the very rare case that an program is looking trough your registry for an specific key, it will take longer to find it because there may be invalid keys on the way. But usually programs or Windows know where their own keys are located or where are going to be installed/created, so the performance in this case is not affected by them.

But as I was saying, the myth started way back in the old days. Remember when hard drivers had a size of 32Mb or even 64Mb?! In those days, you need to save as much space as you possibly could, and since drives were slow, well defragmented files were necessary to keep the system at full speed. These invalid keys could possibly have little but clear effect on the performance due to these files (where registry is stored) being defragmented, but today this is completely irrelevant.

The increase of performance we may get by removing invalid keys from our registry it’s so little, so miserable that in most cases you won’t even get a before-after difference, it will just be the same. The question we should ask ourselves is how, or why, the registry affect performance? Let me start by saying that the effect is little, small, minimal, so miserable that I’m just answering this question as a formality.

The registry is, in fact, loaded into your RAM as soon as your system starts, so let me quote:

The key located by HKLM is actually not stored on disk, but maintained in memory by the system kernel in order to map all the other subkeys. Applications cannot create any additional subkeys. This key contains four subkeys, "SAM", "SECURITY", "SYSTEM", and "SOFTWARE", that are loaded at boot time […] A fifth subkey, "HARDWARE", is volatile and is created dynamically, and as such is not stored in a file […]. On Windows Vista and above, a sixth and seventh subkey, "COMPONENTS" and "BCD", are mapped in memory by the kernel on-demand and loaded from %SystemRoot%\system32\config\COMPONENTS or from boot configuration data, \boot\BCD on the system partition.

What does this mean? That even if part of the registry has a local file size, the main part of it that could affect our performance is loaded into RAM and it doesn’t affect it because it already has a pre-loaded set of keys to load, so it won’t actually affect your performance… at all, specially if you have 8Gb of RAM or more. And the files that are stored, if fragmented, defragment them if you want.


TL, DR: if your registry takes 1Gb in space, reinstall Windows.

No comments:

Post a Comment