//Cloud notes from my desk -Maheshk

"Fortunate are those who take the first steps.” ― Paulo Coelho

Prefer Single Large Assemblies Rather Than Multiple

How would you prefer to ship your compiled assemblies in your product ? Would you separate out or bundle it ? whatever may be the reason..it is recommend to bundle it for better performance. This is from MS P&P teams link-

src : http://msdn.microsoft.com/en-us/library/ms998530.aspx
Prefer Single Large Assemblies Rather Than Multiple Smaller Assemblies
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:
• The cost of loading metadata for smaller assemblies.
• Touching various memory pages in pre-compiled images in the CLR in order to load the assembly (if it is precompiled with Ngen.exe).
• JIT compile time.
• 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.

2010-12-15 Posted by | .NET General | Leave a comment


%d bloggers like this: