How to: Load My Configuration Data

What is the best way to load your web application configuration? All web applications today have at least a single configuration file or multiple ones. What is the best way to load your configuration file? from database, from an XML file, from INI file or from SESSIONS??? To find out which method is the best I decided to run a few tests for each method and to see the time that a method required to be executed and how much memory it needed.

My conclusions where that as many times as I run the tests saving configuration data in sessions is the fastest way with a slightly difference in memory usage which increases a bit compares to loading from the INI file. Loading the configuration settings of your application in sessions or INI file saves resources and improves performance. I thing that a good practice is to have configuration in INI file and when ever the file updates to load the configuration for each visitor in its sessions instead of reading from INI. But at what cost?

Below you can see the results generated on the fly. http://digitzone.net/classes/PerformanceTests/

Leave a Reply