How GUID.NewGuid(); affects CRM performance?

Recently I read this interesting article which explains how CRM uses sequential GUIDs for performance and recommends that users creating a record in CRM using SDK message, either in plugin or workflow should use the create GUID service instead of using System.Guid.NewGuid().

Microsoft Dynamics CRM SDK Best practices for developing with Microsoft Dynamics CRM, states, “Allow the system to automatically assign the GUID (Id) for you instead of manually creating it yourself”. This suggestion allows Microsoft Dynamics CRM to take advantage of sequential GUIDs, which provide better SQL performance.

A plugin or an application that needs to create records in CRM using the SDK populate the record’s ID with GUID generated using System.Guid’s NewGuid method. The System.Guid’s GUID does not generate a sequential GUID which affects the performance.

Detaild explanation provided in below link. Thanks!

http://blogs.msdn.com/b/crminthefield/archive/2015/01/19/the-dangers-of-guid-newguid.aspx

Advertisements

Performance Best Practices for Dynamics CRM

  1. Use multithreaded application.
    Add threading support to your application to break up the work across multiple CPUs.
  2. Allow the system to automatically assign the GUID instead of manually creating it.
    This suggestion allows Microsoft Dynamics CRM to take advantage of sequential GUIDs, which provide better SQL performance.
  3. Use early-bound types where ever possible.
  4. Write plug-ins that execute faster.
    If you intend to register your plug-ins for synchronous execution, we recommend that you design them to complete their operation in less than 10 seconds.
  5. Limit the data you retrieve.
    When you use the methods that retrieve data from the server, retrieve the minimum amount of data that your application needs. You do this by specifying the column set, which is the set of entity attributes to retrieve.
  6. Limit operations that cascade to related entities.
    When you use the Update method or UpdateRequest message, do not set the OwnerId attribute on a record unless the owner has actually changed. When you set this attribute, the changes often cascade to related entities, which increases the time that is required for the update operation.

http://msdn.microsoft.com/en-in/library/gg509027.aspx