This article refers to the CLR Via C #
When designing your own type, carefully consider whether you want to define it as a value type rather than a reference type. At some point, value types can provide better performance, and the primary advantage of value types is that they are not allocated as objects on the managed heap.
All of the following conditions are appropriate for defining a type as a value type:
1. The type has primitive type behavior. In other words, this is a very simple type, where no member modifies any field of the type. If a type does not provide a member that changes its field, it says that the type is an immutable type. In fact, for many value types, we recommend that all of its fields be marked as readonly (read-only);
2. Type does not need to inherit from any type;
3. Types are also not derived from any type.
The size of the type instance should also be taken into account because, by default, the arguments are passed by value, which results in the replication of the fields in the value type instance, which can damage performance. Similarly, a method that is defined to return a value type when returned, the fields in the instance are copied into the memory allocated by the caller, thereby damaging performance. All, to define a type as a value type, in addition to the above reasons, the following conditions are met:
1. Examples of types are small (about 16 bytes or less);
2. The instance of the type is large, but not as an argument to the method, nor as the return value of the method.
Defining value types