资源文件做多语言性能怎么样.在本机做测试 Stopwatch timer = new Stopwatch();
timer.Start();
for (int i = 1; i <= 10000000; i++)
{
lang.AAA; //资源文件里的一个字符串
}
timer.Stop(); decimal micro = timer.ElapsedMilliseconds;
Response.Write(micro);
以上这样执行速度在4000毫秒左右.改成变量, 只要53毫秒.
Stopwatch timer = new Stopwatch();
timer.Start();
for (int i = 1; i <= 10000000; i++)
{
int bbb = 123124;
}
timer.Stop(); decimal micro = timer.ElapsedMilliseconds;
Response.Write(micro);
问一下大神们, 资源文件是不是放在缓存里? 有没有做多语言推荐的解决方案呢?
timer.Start();
for (int i = 1; i <= 10000000; i++)
{
lang.AAA; //资源文件里的一个字符串
}
timer.Stop(); decimal micro = timer.ElapsedMilliseconds;
Response.Write(micro);
以上这样执行速度在4000毫秒左右.改成变量, 只要53毫秒.
Stopwatch timer = new Stopwatch();
timer.Start();
for (int i = 1; i <= 10000000; i++)
{
int bbb = 123124;
}
timer.Stop(); decimal micro = timer.ElapsedMilliseconds;
Response.Write(micro);
问一下大神们, 资源文件是不是放在缓存里? 有没有做多语言推荐的解决方案呢?
资源写在app里面,不常用可以临时读