Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve and Deploy to sandbox is very slow #917

Closed
amitkumarj1979 opened this issue Aug 22, 2018 · 69 comments
Closed

Retrieve and Deploy to sandbox is very slow #917

amitkumarj1979 opened this issue Aug 22, 2018 · 69 comments
Labels
area:deploy/retrieve type:feedback Feedback for new features

Comments

@amitkumarj1979
Copy link

Summary

When using the prerelease version against a sandbox the Deploy and Retrieve takes lot of time even though its a single file or component.

Steps To Reproduce:

  1. Once you retrieve the complete package.
  2. Try to retrieve a single Apex class. you will see it takes lot of time.
  3. Same with Deploy as well.

Expected result

Single files should be much faster the whats its today.

Actual result

Performance should be much better.

Additional information

Feel free to attach a screenshot.

VS Code Version: 1.26.1

SFDX CLI Version: Pre release

OS and version: Windows 10
Internal Work Item: W-5552612

@evanmcd
Copy link

evanmcd commented Aug 27, 2018

I found the same running on macOS 10.12.

Specifically, a deploy that would take 2-3 secs in MavensMate/SublimeText is takes more than 90 secs with VS Code SDFX.

@vazexqi
Copy link
Contributor

vazexqi commented Aug 27, 2018

@amitkumarj1979 and @evanmcd - Could you do the following for me in Powershell/Terminal and report:

# Windows

# Go into the correct directory of your project
Measure-Command { sfdx force:source:deploy --sourcepath the/apex/file/to/deploy.cls }

# Mac

# Go into the correct directory of your project
time sfdx force:source:deploy --sourcepath the/apex/file/to/deploy.cls

@vazexqi
Copy link
Contributor

vazexqi commented Aug 27, 2018

Also could you do a sfdx plugins so that we can see what version of the pre-release of salesforcedx you have.

@amitkumarj1979
Copy link
Author

amitkumarj1979 commented Aug 27, 2018 via email

@vazexqi
Copy link
Contributor

vazexqi commented Aug 27, 2018

@amitkumarj1979 - Yes, it should be sfdx force:source:deploy. Let me edit the previous message.

@vazexqi
Copy link
Contributor

vazexqi commented Aug 28, 2018

We have pushed a new version of the salesforce@pre-release dist-tag to public npm that could address some of these issues (this was based on our own internal testing).

Please upgrade using sfdx update. After upgrading, please confirm that sfdx plugins shows the following entries (in addition to others you might have):

salesforcedx 44.0.14 (pre-release)

Let us know if you see improvements (or other issues).

@evanmcd
Copy link

evanmcd commented Aug 28, 2018

Hey @vazexqi, here's what I got from time (though the first time through never resolved, and I needed to restart VSC):

SUN-MBP-EvanM:Sandbox EM evanmcdaniel$ time sfdx force:source:deploy --sourcepath "/Users/evanmcdaniel/Projects/Sandbox EM VSC/Sandbox EM/force-app/main/default/pages/ContractTools.page"
WARNING: apiVersion configuration overridden at 43.0
=== Deployed Source
FULL NAME      TYPE      PROJECT PATH
─────────────  ────────  ────────────────────────────────────────────────────────
ContractTools  ApexPage  force-app/main/default/pages/ContractTools.page
ContractTools  ApexPage  force-app/main/default/pages/ContractTools.page-meta.xml

real    0m17.229s
user    0m2.428s
sys     0m0.337s
SUN-MBP-EvanM:Sandbox EM evanmcdaniel$

Result of plugins is salesforcedx 44.0.14 (pre-release)

@amitkumarj1979
Copy link
Author

Hi @vazexqi, Below are the outputs for the commands you requested.

Plugins:

salesforcedx 44.0.14 (pre-release)

Measure Command


Seconds : 42
Milliseconds : 530
Ticks : 425308248
TotalDays : 0.000492254916666667
TotalHours : 0.011814118
TotalMinutes : 0.70884708
TotalSeconds : 42.5308248
TotalMilliseconds : 42530.8248

There are some improvements from the last release.

But i think its slow for such a small Apex class file.

@vazexqi
Copy link
Contributor

vazexqi commented Aug 28, 2018

@amitkumarj1979 - This timing probably includes the CLI time and also the time for the network compilation. We would need to drill into this a bit more.

Could it be that your single Apex class is like a God class that depends on many other things and trigger a lot of compilation on the server side? Or is it a simple Apex class? The dependencies that the class has also affects deployment times.

The CLI can only affect the packaging (to a .zip file), transmitting, receiving, and un-packaging.

@evanmcd
Copy link

evanmcd commented Aug 28, 2018

@vazexqi comparisons with the same file: from Illuminated Cloud and MavensMate with SublimeTest are about 6-7 seconds.

@vazexqi
Copy link
Contributor

vazexqi commented Aug 28, 2018

Thanks @evanmcd. That's a useful comparison. We will do some more testing on our side (and maybe output more info on how long each stage takes as a flag to the user to get more info).

@amitkumarj1979
Copy link
Author

@vazexqi - Hi Nick, did u have chance to look at the performance issues ?

@vazexqi
Copy link
Contributor

vazexqi commented Sep 5, 2018

We are adding new logging to the Salesforce CLI so that we can better diagnose this. We are still testing this internally. When it's ready we will provide more details on how to enable it.

@amitkumarj1979
Copy link
Author

@vazexqi - Did you find anything on this with the Release date close now ?

@lcampos
Copy link
Contributor

lcampos commented Oct 10, 2018

@amitkumarj1979 @evanmcd just to keep you up to date with this. We did find some areas in the code that need to be changed. While the work for this has started, we did find that the changes needed are bigger than expected. We don't have an estimate on when this work will be ready to be released but we'll post an update on the timeline once we have one.

@FabienTaillon
Copy link

I still have very slow deployment from time to time, but mostly due to deploy pending server side.
Even if this is not directly linked with this plugin development, waiting for almost 10mn to save a file is not a great experience.

deploy

@zacrobat
Copy link

I'm also experiencing slow deploy times. Testing vs MavensMate I find SFDX deploys the entire Lightning Component Bundle (cmp, css, js...) while MavensMate only deploys (on save) the file you saved (just the css file for example). MavensMate is 1.5 seconds vs 10 seconds with SFDX: Deploy this source to org.

Is there a way to deploy a single file instead of the aura bundle with SFDX? I haven't found a way to do that.

@FabienTaillon
Copy link

I wonder why it's using the deploy command instead of using the tooling APIs like the dev console ? Seems much faster.

@ntotten
Copy link
Contributor

ntotten commented Jan 10, 2019

We have a fix coming soon that will provide a very significant performance increase.

@amitkumarj1979
Copy link
Author

That will be awesome, looking forward to it. Do you have any ETA for that ?

@ntotten
Copy link
Contributor

ntotten commented Jan 10, 2019

Not exactly, but it will be in the next month or so.

@e02d96ec16

This comment has been minimized.

@ntotten ntotten transferred this issue from forcedotcom/salesforcedx-vscode Jan 28, 2019
@ntotten ntotten transferred this issue from another repository Jan 28, 2019
@ntotten ntotten added the type:feedback Feedback for new features label Jan 28, 2019
@ntotten
Copy link
Contributor

ntotten commented Jan 30, 2019

Anyone on this thread who has experienced slow retrieves/deploys please email me details. We are working on definitively solving this problem once and for all and I need as much data as possible. OrgId, time, logs, command run, etc. The more detail the better. ntotten@salesforce.com

@trailheaddxvinod
Copy link

@ntotten - I'm experiencing this today and I'm on government cloud. Any issues or risks with using salesforce extension pack for vscode/salesforce cli on government cloud?

@ntotten
Copy link
Contributor

ntotten commented Feb 6, 2019

@trailheaddxvinod The issue generally isn't with VSCode or the CLI, it is usually with the backend APIs. Feel free to email me details per the instructions here: https://github.com/forcedotcom/salesforcedx-vscode/wiki/How-to-Collect-Performance-Information-for-Support

@amitkumarj1979
Copy link
Author

info.txt
log.txt

Attached are the files.

@cadencereplies
Copy link

Any updates here? Still need more data?

@ntotten
Copy link
Contributor

ntotten commented Jun 7, 2019

@monirkohi2006 There isn't anything public about it. It's purely internal systems updates and will have no functional changes to APIs, etc. Its a performance update on how queues work internally which is intended to speed up deployments.

@delcs827
Copy link

Can confirm this is happening to me as well. 2 minutes to deploy a LWC seems much longer than it should normally take.

@aotolbert
Copy link

I can also confirm that it can take up to 5 minutes to deploy (from VS Code using integrated CLI) and I often have to cancel the deploy and try again multiple times before it is successful within an "acceptable time-frame" nowadays about 20-30 sec.

@pibenettmodis
Copy link

The same here! Could you solve this please :)

@arunmitteam
Copy link

Is there any workaround for this? It has become totally unusable at this time.

@monirkohi2006
Copy link

This issue was reported on Aug 22, 2018. Any update please?

@mitchspano
Copy link

I am facing deploy and retrieve times exceeding 10 minutes in my development environment.

@michaelsoriano
Copy link

michaelsoriano commented Jul 15, 2019

Same situation here. There is a significant delay when saving and deploy - as described by @ChuckJonas above. #917 (comment)

I updated sf cli to version: 7.14.0

Do I have to uninstall / install vscode extensions?

Please advise.

UPDATE:

This is now working. I had to recreate the project using sfdx.

@cemerson
Copy link

cemerson commented Aug 13, 2019

+1. Retrieve is currently painfully slow for me too. I actually haven't finished one Retrieve yet so I'm not sure how long it takes but 10+ minutes so far. I even tried the SFDX: Auth first even though I'd assume that shouldn't have to happen every VS Code session (?).

  • VS Code 1.36.1
  • Salesforce Extension Pack: 46.9.0
  • Windows 10 x64

Update #1:

  • My Retrieve went for 15 minutes but never ended so I cancelled it.
  • BTW I had run Retrieve originally by right-clicking my "\classes" folder
  • I ran a new Retrieve by opening my manifest/package.xml, right-clicking in it and initiated another Retrieve Source from Org
  • This new Retrieve ended fairly quickly (maybe 1 min or 2).

I'm not sure if my situation is new or the core speed issue w/Retrieve is resolved - but wanted to share my experience/update.

@wwwmonkey
Copy link

Deploy to Org of a small LWC component takes 2-20mins currently on our project.

@talcarmi
Copy link

@ntotten experiencing 5 minutes to deploy tiny LWC to sandbox

@timswilson
Copy link

I'm experiencing the same as @wwwmonkey 2-20 minutes to deploy LWCs. This has killed my productivity. I can't tell if it is dependent on time of day or not. Right now it is 10 pm for me and deploy source to org is taking 10 minutes on average.

@handlerda
Copy link

I am running into the same problem. It takes anywhere from 2-25 minutes for me to deploy to the source.

@timswilson
Copy link

@handlerda, my issue ended up being due to a faulty sandbox. I have heard of that happening to other people but hadn't experienced it myself until this issue. I was working in a recently refreshed sandbox that for whatever reason was causing this issue. I created a new sandbox, deployed my code over to it and the issue was resolved.

@handlerda
Copy link

@timswilson thanks for the quick response! I am working in GovCloud so that could be part of it. Sometimes it's super quick and sometimes it will take 20+ minutes. I will keep your suggestion in mind to see if other sandboxes are just as slow!

@pranayjswl007
Copy link

I am not sure if refreshing sandbox and expecting it to work is a better strategy. It can happen you refresh n times and you get such faulty sandboxes every time. I refreshed 1 today, super slow 3-8 mins for most deployments, I do agree sometimes it does save in 2-3 seconds.

@handlerda
Copy link

@pranayjswl007 I agree. It's just so inconsistent. Today I have ranged from 2seconds to 22 minutes.

@jacobpeterson2012
Copy link

Just adding to the list of people facing this issue. Facing at least 20 mins for small sfdx force:source:deploy executions. We have also noticed this more recently in our CI process, which in the last week has failed multiple times due to timeout in our job which is waiting for deploy to finish.

@ram4ufriends
Copy link

I am guessing its an issue with the extension itself..because using same org and same package file, ForceCode retrieves components in half the time against SFDX Plugin..

@rajendrasnagar
Copy link

rajendrasnagar commented Feb 18, 2021

I am facing slow deployment issues when I am working on using Apex Enterprise patterns. I don't know, whether it validate something internally or what. But it usually takes > 10 minutes to deploy.
image

@smaddox-sf
Copy link
Contributor

@rajendrasnagar & All - We've done significant work to make deploys & retrieves faster, particularly for single file scenarios. The work is still in progress so for now you need to check the "Deploy Retrieve" setting in VS Code to try it the changes.

image

@vpreet
Copy link

vpreet commented Feb 22, 2021

OMG. This is a true life saver. Good bye to frustrating hours of staring at the screen doing nothing. Good bye to sick and tired of excuses during every sprint meeting why a dev/deploy job that takes hardly an hour ends up taking whole day. Tried single file retrieve and deploy of an Apex and an LWC. It is lightning fast. For the time being I care only about that. Hope other features also speeds up in near future. This is Godsend especially for heavy UI LWC development. You won't even remember what finer UI change you were trying to accomplish if you have to wait for five minutes( and lose focus) to see the results on screen. Hope this speed stays that way. Awesome. Thank you very much.

@sushilgit
Copy link

sushilgit commented Mar 8, 2021

Hello @smaddox-sf , Thank you for improving speed of retrieve process. Its running lightning fast for some objects. But does fail for some. e.g. I tried for case and opportunity and i ran into some issues. screenshot attached. It does not show any specific error. let me know if i can provide some additional information.
image

@smaddox-sf
Copy link
Contributor

Hi @sushilgit - Thanks for trying it out and glad it's helping at least some of the time. Can you open a new issue with the details of the steps you are executing so we can try to repro & fix it?

@smaddox-sf
Copy link
Contributor

Hi All - Closing this issue as the deploy / retrieve performance enhancements are now in use by default. You can check to see if you are using them by checking the "Deploy Retrieve" setting in VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:deploy/retrieve type:feedback Feedback for new features
Projects
None yet
Development

No branches or pull requests