VSCode / Salesforce - Deploy Source to Org very slow to complete, although actual deployment is fast?

2.9k Views Asked by At

I don't know when this started working, but my deployments are horifically slow now and I'm not sure why...

I change a single apex class, right-click the file and pick SFDX:Deploy Source to Org, and it's taking well over 5 minutes for the "Running..." scrollbar to vanish.

The weird thing is, if I look in the Org under "Deployment Status", it completed ages ago, taking under a minute (start/finish time are the same).

Any ideas what VSCode is doing after the deployment completes that's taking so long? The CLI is on version 7.201.6

4

There are 4 best solutions below

2
On BEST ANSWER

I was facing the same issue today. I faced the issue with v57.15.0. I installed an earlier version of Salesforce CLI which was v57.13.1 and my deployment time is not slow anymore.

0
On

There is a setting in the Salesforce Org that can make a "SFDX: Deploy This Source to Org" take minutes.

In "Apex Settings" in Setup, there is a checkbox for "Perform Synchronous Compile on Deploy", untick it if your deploys are slow.

0
On

A new setting 'Enable Source Tracking For Deploy and Retrieve' was introduced recently, in response to this issue. It is checked by default. https://github.com/forcedotcom/salesforcedx-vscode/issues/4865

I was experiencing the issue described here, but after unchecking that setting my deploys have returned to taking several seconds.

(sfdx-cli/7.205.6 win32-x64 node-v18.15.0)

Another similar issue that I had was that 'Push-or-deploy-on-save' stopped working for me. It was trying to push but not responding. Whilst looking at the above issue, I discovered another setting 'Prefer Deploy On Save'. With this checked I am now back to speedy deploys on save.

enter image description here

This content was originally posted at https://stackoverflow.com. Do not reward video streams of this content on YouTube.

0
On

The answer provided by MikeA is correct. I just need to add:

It must be validated if the extension configuration explained by MikeA applies to the User or workspace configuration.

I had the same problem and I was able to solve it in my case by inactivating the "Salesforcedx-vscode-core › Experimental: Enable Source Tracking For Deploy And Retrieve" option in my workspace.

Therefore it was not necessary to downgrade. VSCode Extension Config - Salesforce CLI

Note: Close and start vscode