title: Slow data processing with Dynamics SDK
body: <p>We're working on a ASP.NET MVC Application that is integrated with Dynamics. The project uses the Dynamics SDK to pass data to Dynamics which is either inserted or updated. It really is quite a light touch integration - during the shop checkout process of the website we collate data and pass it off to Dynamics (which is hosted in Dynamics 365). An example of creating a user account in our Dynamics instance can be seen below:</p>
  
  <pre><code>        public Guid? CreateProfile(IProfile profile)
      {
          using (var xrm = new XrmServiceContext(_crmConnection))
          {
              var crmProfile = new Contact
              {
                  EMailAddress1 = profile.Username,
                  FirstName = profile.FirstName,
                  LastName = profile.LastName,
              };
              xrm.AddObject(crmProfile);
              xrm.SaveChanges();
              return crmProfile.Id;
          }
      }
  </code></pre>
  
  <p>The xrm.SaveChanges() method can take up to 20 seconds to complete. Using Fiddler we can see that there is no major HTTP overhead causing slow requests to the Dynamics instance, which seems to suggest that the processing of the data by Dynamics once it has received the request is slow.</p>
  
  <p>Does anyone have any pointers/tips on how to speed this up, or why it's taking so long to process? If Dynamics were running on a VM i'd just throw extra resources at it, but of course we dont have control over the infrastructure in this scenario.</p>
  
  <p>Any advice would be greatly appreciated.</p>
  
  <p>Thanks for your time in advance</p>
  
  <p>Kind regards</p>
  
  <p>dotdev</p>