C# .NET Performace tips

1. use value type instead of reference type wherever possible.

2. use struct to pass data around (through the web) instead of passing object.

3. use boxing/unboxing only if they are the only option you have got.

4. try not to determind data type at runtime, use generic whenever possible.

5. use dictionary instead of hashtable.

6. batch query in one transaction if possible.

7. use dataReader instead of dataSet, etc.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s