ASP.NET Web.config中的AppSettings性能 [英] ASP.NET Web.config AppSettings Performance

查看:132
本文介绍了ASP.NET Web.config中的AppSettings性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些经常使用在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性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆