none
SharePoint Connection using SharePoint.dll Slow after Upgrade RRS feed

  • Question

  • We recently upgraded our SharePoint 2007 to SharePoint 2013. We use SharePoint.dll to perform any server side logic with SharePoint. After the upgrade we notice that our SharePoint app runs slower compared to 2007. Debugging the app and placing stopwatches, one of the areas we found slow is connecting to SharePoint 2013 using the dll.

    If I use the same code from console app, the result for SharePoint 2007 is 0.7 secs compared to 5.4 secs in SharePoint 2013

    Stopwatch sw = new Stopwatch(); sw.Start(); SPSecurity.RunWithElevatedPrivileges(delegate () { using (SPSite site = new SPSite(documentLibraryUrl)) { using (SPWeb web = site.OpenWeb()) { sw.Stop(); Console.WriteLine(string.Format("SharePoint to open connection: {0}", sw.ElapsedMilliseconds)); } }

    }

    Even uploading document using server side code is slower in SP 2013 compared to 2007.

    Should we still use SharePoint.dll for server side SharePoints app's or should there be different approach.

    Tuesday, January 24, 2017 4:28 PM

Answers