While coding for any Microsoft technology we may need to answer following questions which are important to get answered for giving good performance.
- Does my code properly dispose of SharePoint objects?
- Does my code cache objects properly?
- Does my code cache the correct types of objects?
- Does my code use thread synchronization when necessary?
- Does my code work as efficiently for 1,000 users as it does for 10 users?
To answer these some common type of programming issues some programming guidelines or best practices are given by Microsoft.
For SharePoint related such best practices listed at one of the MSDN article which talks about following –
- Caching SharePoint Objects That Are Not Thread Safe
- Using Objects in Event Receivers
- Working with Folders and Lists
- Deleting Multiple Versions of a List Item
- Using SPQuery Objects
- Using Web Controls
- Creating Timer Jobs
So please have a look at –
To adhere best practices and reduce risk of memory leak and get better performance.