Understanding what makes up a comparison

When you hit COMPARE NOW for a metadata deployment, the following happens:

  1. Connection established to the selected org via OAuth 2.0

  2. Downloading and retrieving metadata via the Salesforce Metadata API

  3. Caching the metadata

  4. Comparison is initialized and displayed

Of course, this has to be run once for each org: once for the source and once for the target. These are run in parallel in order to reduce the time it takes as much as possible. It's stage two that takes the most time, so that's what we'll need to look at.

Factors to consider

If your metadata comparison is taking a while to load, there are essentially two contributing factors to consider:

  1. The current load on Salesforce servers

  2. The amount of metadata being requested

During peak hours in the US, when the greatest number of users are active on the Salesforce platform, the speed of the service slows down. Unfortunately, there isn't anything that can be done to speed this part up - we're reliant on how quickly the Salesforce Metadata API is able to retrieve your metadata.

If you'd be interested in testing the Salesforce API download speeds outside of Gearset, you are able to do this with Workbench. We have an article on this here.

Aside from server limitations, there is a way that you can significantly decrease the time it takes to run a comparison. This is achieved by reducing the amount of metadata being requested in the first place.

Using filters to reduce metadata selection

Without a doubt, the largest factor in determining the speed of your comparison is the amount of metadata that's been selected in the filters.

Reduce the metadata types

You may have already noticed that our default filter selection only includes 64 metadata types; this will already be a dramatic improvement over using the Compare all selection. However, to further improve, we recommend that you reduce this selection and only include the metadata types that you need. The more you remove, the less unnecessary metadata will need to be retrieved, and the faster it'll be.

Reduce the named items

You can also use the Named items filter to narrow down which items to compare within a metadata type. Instead of comparing all metadata items within a single metadata type, this will reduce the request to only specific items.

As well as simply selecting checkboxes, you can use regex filtering in Named items, described in this support article.

Example

As an example, let's take a deployment of Profile: Flow Access for just the Admin profile. Our filtering system allows you to be very specific, so rather than selecting the default 64 metadata types, you could customise the selection and only select the ones relevant to the change you're looking to make. In this case, we've selected the following:

  1. Selected just the top level metadata types (Profile and Flow definition)

  2. Within Profile, I've used the slider to switch from All items to Named items, and only selected the Admin profile

You should find that reducing the filter selection like this reduces your comparison time. For full details on how to utilize custom metadata filters, we have a general support article on managing them here.

Did this answer your question?