My guess is that most applications wouldn't notice a signifigant
performance difference between the two options. My only concern with
Application variables is that the runtime has to acquire a
ReaderWriter lock before retrieving an object from the collection.
This should not be a signifigant overhead in most applications, but
only some testing and benchmarking could tell.
Another option is to expose the strings through static properties on a
class, perhaps the Global class in global.asax. Read them once from
web.config and then they are easy to grab from anywhere in your code
with code like Global.MyString. The other benefit of this approach is
that the source of the string, be it the web.config file or somewhere
else is abstracted away.
--
Scott
http://www.OdeToCode.com
On Tue, 29 Jun 2004 19:21:02 -0700, JMD
<JM*@discussions.microsoft.com> wrote:
I am curious to know if there are performance issues in choosing between A and B. Which performs best?
A. store string values in the web.config and pull them using ConfigurationSettings.AppSettings
B. Use Application_OnStart to store string values in Application variables