我有一些经常使用在web.config中的appSettings的(即每个帖子后面)。是否ConfigurationManager中过程中持有这些值,或在那里通过ApplicationStart复制这些值转换成应用程序状态(),随后从那里获取它们来有过任何的性能提升?
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?
推荐答案AFAIK配置被读取并在启动时解析和数据在存储器此后保持。因为你不乱丢code。与 ConfigurationManager.AppSettings [虽然你可能会提高可读性... - 我不从缓存中应用程序变量的状态将是显著相信任何的性能提升] 。
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[...].
更多推荐
ASP.NET Web.config中的AppSettings性能
发布评论