views:

74

answers:

3

Hi,

I am working on performance optimizing for our legacy application. It use VC++ 2008, OS is WindowsXP or above.

In installation, it will parse a file and write some information about the file into registry. With the files count increasing, the installation need very long time.

I try to comment the code that write to registry, and it will reduce the installation time sharply. But we can't remove the registry action.

In old code, it will use RegCreateKey and RegSetValueEx to set the registry data.

So I try another method, I write the data into a file, and call the function like "regedit /s /c aaa.tmp" to import the file. It will reduce some time, but not significant.

Could you suggust me some method could try? Many thanks,

Well

+1  A: 

If you're writing data to the registry frequently enough that performance matters to your user, then you're doing too much of that, and the data should rather be written into a simple file.

Carl Smotricz
The application is a legacy one, and I am asked to improve the performance.I can't change the option from registry to other, even I want too.And the key/value should be same as old too. Because it will be used by other client. It is the problem.
sagasw
A: 

Registry I/O was never well optimized, as it's not meant to be done often. However, your customers may benefit a little from using products such as RegClean to reduce the size of their registries.

Carl Smotricz
A: 

You might be using too many keys or opening and closing them too many times. Storing all your values under one key and keeping it open until you finish writing to it might improve performance.

Don Reba