- If you are using SPList.Items.Add, start using SPList.AddItem. Since reference to SPList.Items properly will load list data it will not perform good.
- If you are accessing list, try to use caml query to access it and always use RowLimit and view field properties to limit output to exactly what you want.
- use ContentIterators in place of foreach when you want to iterate list items.
May 10, 2012
Performance analysis: Part 2
In previous post we used Stopwatch object in order to compare time taken by SPList.ItemCount and SPList.Items.Count. Here are additional things to add in list.