Narrowing down the Performance optimization in Sharepoint

Here are some best alternatives for splist.items for better performance…

  • SPList.Items.Count to SPList.ItemCount
  • SPList.Items.XmlDataSchema to Create an SPQuery object to retrieve only the items you want
  • SPList.Items.NumberOfFields to Create an SPQuery object (specifying the ViewFields) to retrieve only the items you want.
  • SPList.Items[System.Guid] to SPList.GetItemByUniqueId(System.Guid)
  • SPList.Items[System.Int32] to SPList.GetItemById(System.Int32)
  • SPList.Items.GetItemById(System.Int32) to SPList.GetItemById(System.Int32)
  • SPList.Items.ReorderItems(System.Boolean[],System.Int32[],System.Int32) to Perform a paged query by using SPQuery and reorder the items within each page.
  • SPFolder.Files.Count to SPFolder.ItemCount
  • Note:
    The SPList.ItemCount property is not entertained however you can refer my previous post for more details

    Leave a Reply

    Your email address will not be published. Required fields are marked *