473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ConfigurationSettings.AppSettings vs. IIS Application

JMD
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
Nov 18 '05 #1
4 1399
You might get opinions on this (which may be more or less valid), or you can
get more objective results by using Microsoft Application Center Test (ACT)
which ships with Visual Studio.NET. You can set up fairly simple scripts and
run a test between competing scenarios to see which perform the best.

http://msdn.microsoft.com/library/de...l_ref_prps.asp
http://msdn.microsoft.com/library/de...l_ref_prps.asp

Good Luck

"JMD" <JM*@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
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

Nov 18 '05 #2
I would guess that the Application variables would be faster. The Web.config
is cahced anyway, but Application_Variables are "permanently cached" in a
manner of speaking.

Storing data in static variables/static class properties would be faster
than both of them.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Henry Johnson" <ok**@dokey.com> wrote in message
news:uA**************@tk2msftngp13.phx.gbl...
You might get opinions on this (which may be more or less valid), or you can get more objective results by using Microsoft Application Center Test (ACT) which ships with Visual Studio.NET. You can set up fairly simple scripts and run a test between competing scenarios to see which perform the best.

http://msdn.microsoft.com/library/de...l_ref_prps.asp http://msdn.microsoft.com/library/de...l_ref_prps.asp
Good Luck

"JMD" <JM*@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
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

Nov 18 '05 #3
"JMD" <JM*@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
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


Actually, if you're concerned about performance, you might want to do
performance testing in your own environment. If there were performance
differences, they might depend on the environment.

As it happens, there would be little difference, except perhaps readability
differences. ConfigruationSettings.AppSettings caches the values from
web.config, so even if you reference them on every page, there should be
little performance hit.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #4
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


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rob Mayo | last post by:
I'm developing a server control for our intranet. This control is only going to be used in two applications on the server, but they must be separate. It has been established that these 2 apps...
5
by: Derrick | last post by:
I have a C# console app, MyApp, and am placing an application config file in the same debug dir as MyApp.exe. I have named the file MyApp.config, and MyApp.exe.config. I cannot read the...
1
by: [myfirstname] | last post by:
Hello I've seen several examples around the web where people put all the values in ConfigurationSettings.AppSettings into Application State variables in global.asax, like this: foreach...
3
by: Random | last post by:
I'm writing a class library for my web app data access, but don't want to hard code the database connection string in the class. Nor do I want to pass the connection string in from the web app...
1
by: Dean Slindee | last post by:
What is the VS2005 version of ConfigurationSettings.AppSettings: Dim strTemp As String strTemp = ConfigurationSettings.AppSettings.Get(Application.ProductName & "/" & strKeyID) Thanks,...
2
by: Dean Slindee | last post by:
What is the VS2005 version of ConfigurationSettings.AppSettings: Dim strTemp As String strTemp = ConfigurationSettings.AppSettings.Get(Application.ProductName & "/" & strKeyID)
1
by: Jenny | last post by:
Hello, I read my applications App.Config file using ConfigurationSettings.AppSettings When I try to check it's last access write time using File.GetLastWriteTime and the refresh new data...
8
by: Mark | last post by:
Could someone provide me with details or a link on how the line of code executes underneath the hood? Assume it's executed in an ASP.NET application. string blah =...
1
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add...
2
by: mark4asp | last post by:
In trying to get the C# conversion code for Head First Design Patterns to work I came accross a number of warnings. e.g. Warning Number: 10 Description: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.