Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Web.config AppSettings Performance

I have a number of appSettings in web.config that are used frequently (i.e. on each post back). Does the ConfigurationManager hold these values in process or are there any performance gains to be had by copying these values into application state on ApplicationStart() and subsequently retrieving them from there?

like image 496
Oundless Avatar asked Aug 20 '09 08:08

Oundless


1 Answers

AFAIK the configuration is read and parsed at startup and the data is held in memory thereafter. I don't believe any performance gains from caching the state in application variables will be significant - though you may get improved readability as you don't litter the code with ConfigurationManager.AppSettings[...].

like image 121
Vinay Sajip Avatar answered Oct 21 '22 07:10

Vinay Sajip