Boxing and unboxing is rather an expensive process in terms of computation. So if you use it in array of list, the cost of boxing and unboxing goes high to the number of times the entities in list or array. When a value type is boxed, an entirely new object must be created. This can take up to 20 times longer than a simple reference assignment. When unboxing, the casting process can take four times as long as an assignment. [1]
String concatenate is a very common thing possibly every developer do day in, day out but possibly you are doing It all wrong.
If you are using string concatenate with large number of variables or loop, instead of using “+” operator or Concatenation Operators use use System.Text.StringBuilder. [2]
Instead of using foreach use for loop. Now you may wonder what is wrong with foreach, there is nothing wrong with foreach but few points of it makes it more expensive in terms of memory and computation power.
Instead of putting try / catch block inside of loop, Surround the entire loop inside of try / catch block.[4]
While adding try/catch is cheap, throwing an exception is expensive. For example, checking if something can be parsed by calling int.Parse() and catching an exception should be avoided. Instead, you can use int.TryParse() which return false If parsing is impossible.
Activator.CreateInstance()
myType.GetMethod("Foo").Invoke()
dynamic type is really expensive, try avoiding it entirely if possible.