views:

95

answers:

2

I am building a webpart that includes a function with an SPList as one argument. The list being passed will grow over time which makes me concerned about a scalability issue. Should I worry about potential performance issues using this method?

If you can offer any insight on other SharePoint objects (SPSite, etc) pertaining to my question or provide a link to further reading on this topic, I would be very appreciative!

+2  A: 

Why would this be a problem? Do you expect the data in the list will be copied when you call the function? It won't be. SPList is a reference to an SPList object, and you'd only be copying the reference.

Otherwise, I can't think why there would be a scalability problem. Please indicate why you think there might be one.

John Saunders
That was my question exactly. I wasn't sure exactly how C# was passing the objects. One more question to satisfy my curiosity however: would there be any difference between declaring/passing the SP object with ref versus simply passing it 'normally'?
Steve Ruiz
You haven't said what language you're using, have you?References are references. If, for some reason, you passed a reference to the reference, then you're still passing a reference.
John Saunders
+2  A: 

If you want an insight on performance with SharePoint objects you should read about SPSite and SPWeb disposing. Every SharePoint developer should know about those.

http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx

JMD