是否CloudConfigurationManager GetSetting方法缓存? [英] Does the CloudConfigurationManager GetSetting method cache?

查看:114
本文介绍了是否CloudConfigurationManager GetSetting方法缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道,如果你采取的性能损失调用CloudConfigurationManager GetSetting方法?是否重新分析,例如湛蓝的文件或者是缓存?不知道我是否应该加上我自己的缓存/静态变量来提高所谓常常像一个连接字符串PERF的。

Does anyone know if you take a performance hit calling CloudConfigurationManager GetSetting method? Does it reparse the azure file for example or is it cached? Not sure if I should add my own caching/static variable to improve perf for something called often like a connection string.

感谢

推荐答案

的<一个href=\"https://github.com/Azure/azure-sdk-for-net/blob/master/src/Common/Configuration/AzureApplicationSettings.cs\"相对=nofollow>来源可在github上。

The source is available on github.

如果你看看源,你可以看到,它是没有做任何缓存,所以如果你看到的性能问题,你可能想实现自己的高速缓存。

If you take a look at the source you can see that it isn't doing any caching, so if you are seeing performance issues you may want to implement your own caching.

GetSetting 的身体给出了一个简单的回报:

The body of GetSetting shows a simple return:

value = GetValue("ServiceRuntime", name, GetServiceRuntimeSetting);

if (value == null)
{
    value = GetValue("ConfigurationManager", name, n => ConfigurationManager.AppSettings[n]);
}

return value;

这篇关于是否CloudConfigurationManager GetSetting方法缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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