Why prefer Single Large Assembly rather than Multiple Smaller Assemblies in ASP.NET?

by Rick| Views: 1041

Why prefer Single Large Assembly rather than Multiple Smaller Assemblies in ASP.NET?

What is the impact of using Multiple Smaller Assemblies on the performance of ASP.Net Web Application?

Single Large Assembly VS Multiple Smaller Assemblies for better performance of .Net Application?

Do we get any performance improvement if we you use single assembly in application build upon .Net Framework.

Answers (1)
 
Tech Guru Said..

To help reduce your application’s working set, you should prefer single larger assemblies rather than multiple smaller assemblies. If you have several assemblies that are always loaded together, you should combine them and create a single assembly.

The overhead associated with having multiple smaller assemblies can be attributed to the following:

1) The cost of loading metadata for smaller assemblies.
2) Touching various memory pages in pre-compiled images in the CLR in order to load the assembly (if it is precompiled with Ngen.exe).
3) JIT compile time.
4) Security checks.

Because you pay for only the memory pages your program accesses, larger assemblies provide the Native Image Generator utility (Ngen.exe) with a greater chance to optimize the native image it produces. Better layout of the image means that necessary data can be laid out more densely, which in turn means fewer overall pages are needed to do the job compared to the same code laid out in multiple assemblies.

Sometimes you cannot avoid splitting assemblies; for example, for versioning and deployment reasons. If you need to ship types separately, you may need separate assemblies.



Register or Login to Post Your Opinion/Answer