ASP.NET Web.config中的AppSettings性能

编程入门 行业动态 更新时间:2024-10-26 08:20:39
本文介绍了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性能

本文发布于:2023-11-09 06:17:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571604.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:性能   NET   ASP   Web   AppSettings

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!