Which is faster? The registry or a text configuration file. The question has been raised several times on the comp.os.linux.advoacy and several other UNIX newsgroups. I opted to do some amateur investigation and came up with a program that reads and writes 100 configuraiton values both
Here are the results:
G:\work\programming>reg_test.pl Writing config file took about 6 seconds. Reading config file took about 4 seconds. Writing registry vals took about 26 seconds. Reading registry vals took about 8 seconds.
As you can see, the registry is substantially slower in this test. I didn't plan on using any known weaknesses or strengths in writing these tests, so if there are then they are not intentional. Here's a listing of the source and result files:
This only proves that using the registry in this manner with Perl is slower than using a text configuration file in this manner with Perl.
Here is a C version that was written by Kelsey Bjarnason; I converted it into a visual studio 6 project
My results, running on a Pentium4/1.2ghz (256MB RAM) with Windows 2000:
Release build: FileTest took 4.000000 seconds RegTest took 18.000000 seconds Debug build: FileTest took 3.000000 seconds RegTest took 19.000000 seconds Release build again: FileTest took 5.000000 seconds RegTest took 18.000000 seconds
Although I don't think this test is as fair as the perl test because it doesn't force the text file to parse any configuration names (it just stores the values); but it shows that perl isn't the problem when it comes to speed issues.