We developed an application page in SP2010 that accepts a client id from a legacy system (via a query string) and creates a documentset including name and address metadata in a SP library. On subsequent visits the documentset metadata gets updated. This all worked as expected and within a few seconds.
We then migrated first the same code and then upgraded code to SP2013. Here the creation is still within a few seconds but the update takes about 3 minutes.
As SharePoint creates masses of USL data it is difficult to find any useful information in the logs but a couple of messages stand out:
Leaving Monitored Scope (SPSqlClient). Execution Time=160049.347542774
Leaving Monitored Scope (SPFileStreamManager_From_Native). Execution Time=160050.155815893
Incidentally if we use the SharePoint interface to edit and then save the exact same metadata the application page update then completes within a couple of seconds for all subsequent requests. So it looks like the creation might have the problem.
Has anyone come across this issue before or got any ideas what could be causing it or know how to go about debugging it.
Thanks in advance.