Permormance issue GetItemById

7 Sep

Be careful with the use of GetItemById(), there are two options to use it:
SPList.Items.GetItemById()
SPList.GetItemById()

The difference between the two is that the SPList.Items.GetItemById() loads every item into memory and then filters the set. Trust me: this can cause severe perfomance issues when using this on lists with a large number of items.
SPList.GetItemById() doesn’t do this and is way faster because of this. Be warned!