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

Slow startup #1250

Open
MahdiBM opened this issue Dec 8, 2024 · 7 comments
Open

Slow startup #1250

MahdiBM opened this issue Dec 8, 2024 · 7 comments
Labels
bug Something isn't working SwiftPM Swift Package Manager

Comments

@MahdiBM
Copy link
Contributor

MahdiBM commented Dec 8, 2024

When opening VS Code, it takes 10-20s for VS Code to allow me to run a build task, or run a command plugin.
I'd like it to optimally be under 5s.

When opening the build tasks list (CMD+SHIFT+B) it does not list the tasks before the loading is complete, and it won't update the tasks list when the loading is complete, so I have to keep opening the build tasks list until it finally shows the build tasks.

I'd be fine with being able to immediately queue a build task, but having to wait 10-20s before the build task starts so the extension startup and the package loading complete.

The same goes for testing. The testing tab does now show up until the package loading is complete (I think it also requires a build? or at least it used to).

@adam-fowler
Copy link
Contributor

Can you check to see how long swift package describe takes to run in your project.

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Dec 8, 2024

@adam-fowler to be clear I've noticed this on both big and small projects so I don't think it's related to project size.

First run on a bunch of different projects, it takes 1-1.5s. Next runs 0.5s or less, maybe 0.3s on avg.

@adam-fowler
Copy link
Contributor

I ask because for a while Soto was taking 15 seconds to run that command. The other thing to check is how long all your other extensions take to load. If you disable everything but the swift extension does it still take as long?

When you bring up the build task list VSCode will attempt to activate any extension that might include a build task.

@plemarquand
Copy link
Contributor

> Developer: Show Running Extensions will show each extensions startup time.

I did notice that the initial swift -print-target-info takes upwards of 4.5s during extension activation, which is odd to me since running that command on the command line takes only ~150ms. Not sure how to account for the difference yet.

@award999 award999 added the SwiftPM Swift Package Manager label Dec 11, 2024
@award999 award999 moved this from Unscreened to Backlog in Swift Extension for Visual Studio Code Dec 11, 2024
@plemarquand
Copy link
Contributor

@MahdiBM Did you ever get a chance to investigate how long other extensions were taking to load (Adam's suggestion), and if they were blocking the Swift extension's activation?

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Jan 15, 2025

See these 2 screen recordings about the slownesses and me trying to access plugins (watch at 2x+):

This one is my normal set up in Penny (background build on, resolve packages not disabled, sourcekit-lsp backgroundPreparationMode set to 'build'):
Screen Recording 1 Compressed.mp4.zip

This one I think I tried 2 things in the video. Both with background build off:
Screen Recording 2 Compressed.mp4.zip

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Jan 15, 2025

The extension loading times are reasonable (~30ms).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SwiftPM Swift Package Manager
Development

No branches or pull requests

4 participants