Problems? Is your data what you think it is? | |
PerlMonks |
RFC: config::simple vs config::iniby thanos1983 (Parson) |
on May 20, 2014 at 23:23 UTC ( [id://1086880]=perlmeditation: print w/replies, xml ) | Need Help?? |
Dear all, Recently I discovered, thanks to people of this forum the use of Benchmark. A great powerful tool comparing speeds, processes and times. Well since I love playing around with details I could not resist to make this make not useful test and compare the Config::IniFiles Vs Config::Simple.I decided to run an experiment and observe the output. Update:Thanks to Anonymous Monk and davido for their contributions and suggestions, I have modified my experiment and came up with new data. The experimental code:
I am using a common conf.ini folder that both scripts are reading from with flock process applied since I am planning to use in combination with other scripts. Sample of the conf.ini folder:
The results after the test are the following:
Well to be honest I was expecting the complex version of Config::IniFiles to be faster in comparison to Config::Simple due to simplicity of the code. But the results have proved my assumption wrong. Thanks to Anonymous Monk that he elaborate regarding the tie and OOP process I decided to add also the val process to make it more fair. Also davido point out that the unlock process is a trap and possibly the data can still remain within the process, so it is better to close the file in order to flush the output. Again thank you all for your contribution, to beginners like my self this is a big boost on the learning curve. Well I do not know if this comparison makes any sense to anyone. But since I am beginner and all of this stuff make a huge impression, I felt it would be nice to mention this. Just in case that someone needs to use one of these two solutions to get also an idea about speed.
Back to
Meditations
|
|