foreach(...)
{
SPList list = ...;
SPListIitem item = list.Add();
item[...] = ...;
...
item.Update();
}
I have found that each iteration through this loop gets a lot slower
(expotentially?) as the list gets longer.
Starting with an empty generic list with about 8 custom fields, I get these
results:
Adding items 1 - 500: 24 secs
Adding items 501 - 1000: 65 secs
Adding items 1001 - 1500: 181 secs
Adding items 1501 - 2000: 309 secs
Adding items 2001 - 2500: 461 secs
This pattern mes me think that there is a lot of indexing, etc., checking
for dumpliactes, going on for each add. Is there a way to suspend these
types of things buring a bulk load operation?
Also, are there any WSS services I could temporarily shut off to to make
bulk loads go faster?
Or is there a whole different approach I should be using?
Thanks in advance!
--
Bil Simser
SharePoint MVP, BSc., MCSD
Calgary, Alberta
http://weblogs.asp.net/bsimser
"Stephen Walch" <swa...@online.nospam> wrote in message
news:uNA7fV$zFHA...@tk2msftngp13.phx.gbl:
"Bil Simser [SPS MVP]" <bsi...@shaw.ca> wrote in message
news:eBxa9QB0...@tk2msftngp13.phx.gbl...
--
Bil Simser
SharePoint MVP, BSc., MCSD
Calgary, Alberta
http://weblogs.asp.net/bsimser
"Stephen Walch" <swa...@online.nospam> wrote in message
news:OaSniIF0...@TK2MSFTNGP10.phx.gbl:
Since you are using the object model, I assume you only use the utility in
the intranet. So pleae feel free to use that web service. At intranet, the
web service API should work very well.
If any question, post here and I am glad to be of any assistance for you.
Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance.
You can process batch data through the OM using the
SPWeb.ProcessBatchData method
Assuming you have a SPWeb object called web this code will create an
announcement
Guid listguid=web.Lists["Announcements"].ID;
string xmlcaml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<Batch>" +
"<Method>" +
"<SetList Scope=\"Request\">" + listguid +"</SetList>" +
"<SetVar Name=\"ID\">New</SetVar>" +
"<SetVar Name=\"Cmd\">Save</SetVar>" +
"<SetVar
Name=\"urn:schemas-microsoft-com:office:office#Title\">Project
Meeting</SetVar>" +
"<SetVar
Name=\"urn:schemas-microsoft-com:office:office#Body\">Project Meeting
Event body</SetVar>" +
"<SetVar
Name=\"urn:schemas-microsoft-com:office:office#Expires\">2005-11-1
9:00:00</SetVar>" +
"</Method>" +
"</Batch>";
string returndata=web.ProcessBatchData(xmlcaml);
Unfortunately the syntax is different from the Web api's.
Now whether this that much quicker I don't know it should be.
If I do bulk imports for migrations I disable indexing and make sure
SQL Server is running nicely i.e run a full maint plan making sure all
the tables are contiguous. Log file performance is crucial for inserts
i.e. make sure the log file is on a different drive to your data and
not using RAID 5.
Colin
Free Flash Slideshow WebPart
http://www.flexnetconsult.co.uk/WebParts/WebParts.htm