使用全局程序集缓存增加速度 [英] Speed Increase by Using the Global Assembly Cache

查看:155
本文介绍了使用全局程序集缓存增加速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个1000个asp.net网站,每个文件夹都有30个DLL。



因此,3万个DLL的。



如果我将一组DLL注册到全局程序集缓存中,并且每个站点都使用GAC中的DLL,那么网站/ Web服务器/计算机的运行速度会更快吗?


$ b $例如这些网站会集中使用更少的内存吗?

解决方案

即使程序集在GAC中,它们仍然会从那里分别加载到内存中提供隔离。换句话说,只是因为程序集在GAC中并不意味着这些副本在AppDomains之间共享。我相信mscorlib(可能还有一些BCL程序集)可以在AppDomains之间共享,但是你或我写的任何程序集都不会。



这是一件好事:请考虑缓存类型在AppDomains之间共享。


If I had a 1000 asp.net websites each with 30 DLL's in their /bin folders.

Therefore 30,000 DLL's.

Would the websites / web server / machine run faster if I registered one set of the DLL's into the Global Assembly Cache and each site used the DLL's in the GAC?

e.g. would the websites collectively use less memory?

解决方案

Even though assemblies are in the GAC they will still be loaded from there into memory separately to provide isolation. In other words, just because assemblies are in the GAC doesn't mean that those copies are shared across AppDomains. I believe that mscorlib (and possibly a few of the BCL assemblies) can be shared across AppDomains but any assemblies you or I write will not be.

This is a good thing however: consider the implications of the Cache type being shared across AppDomains.

这篇关于使用全局程序集缓存增加速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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