Channels ▼
RSS

Is the .NET Framework Too Big?


Size isn’t everything, despite what I read in all the spam e-mail I receive. When the .NET framework was first released, it was apparent to me that there was two parts to the library. On the one hand, there are classes that follow a new paradigm and a more object-oriented fashion, for example the various streams APIs. However, there are other parts of the framework that are merely thin wrappers over Win32. You could argue that this implies that the Win32 API was well designed, but equally so, you could also argue that that the time was not spent on designing a more object-oriented API. I have always felt that the framework library was released too early, and I think something can be done about this.

The framework library is huge. If you scan through the list of framework classes, you’ll find that just about (but not completely) everything in Win32 is covered. Look at this list: WMI, Active Directory, OLEDB, XML, XSL, XPath, COM+, MSMQ, Sockets, cryptography, Windows Forms, and GDI+. I have included GDI+ because it is a Win32 feature, and the .NET framework merely provides wrapper classes. In a similar way, Windows Forms is really just a managed version of Visual Basic Forms. Now ask yourself, if you are writing an application, how many of these libraries will you use? In addition, there are some parts of the framework that are completely new: assembly probing, binding and versioning, metadata, configuration, instrumentation, isolated storage, CodeDOM, contexts, .NET Remoting, object serialization, code access security, role-based security, and ASP.NET. I include ASP.NET in this list of new features because it bears little resemblance to ASP, and web controls were a totally new feature. Again, you are unlikely to use all of these features in your application.

However, when you download the .NET redistributable, you get all of these libraries in one large, 24-MB download. If you have a dial up connection, 24 MB is not trivial: If you pay by the minute for that connection, 24 MB can get expensive. I propose that the framework should be split up into smaller redistributables. The basic framework can be found in the mscorlib and system assemblies, with some support DLLs such as fusion.dll, mscorwks.dll, and mscorjit.dll. In general, the optional parts of the framework are in separate assemblies like System.EnterpriseSetrvices and Syste.Windows.Forms.

I have listed all the files in the redistributable for v1.1 of the framework in the download for this newsletter and I have tried to categorize the files according to the type of application that will use them. My results are:

Core Library 16,354,950
Core and Language Support 17,250,793
ASP.NET 4,296,442
Data 1,653,946
Deployment 52,364
Development Tools 5,449,680
Enterprise Development 2,665,313
VS.NET Assemblies 2,231,808
Windows Forms 2,572,288
Grand Total 23,745,895

Some of the files in the “core” library are used to support other languages (Managed C++, Javascript, and VB compatibility in VB.NET), so if those are removed (so that the library only has assemblies from “pure” .NET languages like C# and VB.NET without VB compatibility) then the “core” library is reduced to 16.2 MB. The runtime comes in a workstation and server versions, and both DLLs are provided in the redistributable. You will only use one of these versions on your machine, so by having a redistributable for both versions and installing the correct version, the size of the redistributable can be reduced by a further 2.5 MB. Finally, configuration is based on XML files, which means that the large file, System.Xml.dll, is required. However, its unlikely that the configuration code uses all of the classes in this assembly; a lean version of the configuration parser could reduce the redistributable file by a further megabyte. Thus, I estimate that the redistributable could be reduced to about 12.7 MB. As a comparison, the Sun Java Runtime Environment 1.4.2 is a 14.3 MB download.

In the next newsletter, I will investigate this further by looking at the DLLs that are loaded when your application starts. In the meantime, take a look at the Weblog of my friend and Socket guru, Zane Thomas (http://abderaware.typepad.com/) for more opinions about the size of the .NET framework.


Richard Grimes speaks at conferences and writes extensively on .NET, COM, and COM+. He is the author of Developing Applications with Visual Studio .NET (Addison-Wesley, 2002). If you have comments about this topic, Richard can be reached at richard@richardgrimes.com.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video