Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6570387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:45:01+00:00 2026-05-25T14:45:01+00:00

I just came accross this table : Please let me know what difference in

  • 0

I just came accross this table:

Alternatives to SPList.Items

Please let me know what difference in poor–>better for the last 5 items.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:45:01+00:00Added an answer on May 25, 2026 at 2:45 pm

    he reason for all of this is quite simple. When you write SPList.Items.Count to get the total number of items, SPList.Items returns the collection of all items in the list.
    You don’t want the all items, this can be an expensive action.
    By writing SPList.ItemCount, you make sure you only read a number from the database, and not all items.

    Essentially, this is true for all items in the list – you should generally avoid using the entire Collection objects (i.e. SPList.Items or SPFolder.Files) when you can. Similarly, if you use them more than once, you should cache them using a local variable.

    Here’s an example using indexers. Suppose I have a Guid, and want to get an item.

    SPListItem item = list.Items[guid];

    Looks innocent enough, but it is actually the same as:

    SPListItemCollection items = list.Items;
    SPListItem item = items[guid];

    The point is – SharePoint (and C#, really) doesn’t know what you’re going to do next, or how you’re going to use the collection. The moment you’ve wrote .Items you already made a slow operation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just came accross this today in a Spring MVC cotnroller class, @RequestMapping(value = {
I just came across this code that lets me plot multiple ordinates (I know
Just came across this quote in a book on OOP that I'm reading, A
Just came across this website . Feature 9 is memory management and they claim
Just came across this by Chris Coyier - http://css-tricks.com/examples/CSSTabs/ Can anyone explain me, how
I just came across this code and a few Google searches turn up no
I just came across this question about initializing local variables. Many of the answers
I just came across this idiom in some open-source Python, and I choked on
I've just came across this on GitHub. ($config === NULL) and $config = Kohana::config('email');
I came across this term - Quine (also called self-reproducing programs). Just wanted to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.