Caching is the process of storing frequently used data on the server to fulfill subsequent requests. Grabbing objects from memory is always much faster than re-creating the web pages or items contained in them from scratch each time they are requested. Caching increases performance, scalability and availability...
I posted a question on cvega ’s article on using CIL getters and setters to speed up the execution of heavily reflection-based code asking which one will perform better using DynamicMethod.Invoke or using DynamicMethod.CreateDelegate then calling that delegate. On which he promptly replied. But...
Boxing and unboxing in C# has a performance cost and the use of the IS and AS operator in casting objects is trivial for me. I thought before that: [code language="C#"] if (boxed is Person) { Person unboxed = boxed as Person; //do something } [/code] is better than [code language="C#"] Person unboxed...
[code language="C#"] for (int i = 0; i < collection.Count; i++) { //do something with collection } [/code] I’ve done this before and for me, the efficient way is to store the Count property of the collection rather than access it everytime for the for loop check, lots of indirection involved (I hope...