Skip to content

[Bug]: Low performance in VSCode Extension in Windows #44095

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

Open
niveathika opened this issue May 6, 2025 · 8 comments
Open

[Bug]: Low performance in VSCode Extension in Windows #44095

niveathika opened this issue May 6, 2025 · 8 comments

Comments

@niveathika
Copy link
Contributor

Description

Code suggestions in the Ballerina VS Code extension are not shown up at all. Feels like typing in a notepad. :(

Also, error messages only show for lines I typed earlier — it doesn't seem to update properly with the latest changes.

Image
Image

Steps to Reproduce

Open https://github.com/niveathika/module-ballerinax-cdc/tree/dev and try to edit a util function.

Affected Version(s)

Ballerina 2201.12.3

OS, DB, other environment details and versions

No response

Related area

-> Other Area

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added the needTriage The issue has to be inspected and labeled manually label May 6, 2025
@niveathika niveathika added Priority/Blocker Team/VSCode and removed needTriage The issue has to be inspected and labeled manually labels May 6, 2025
@KavinduZoysa
Copy link
Contributor

We have tried to reproduce the issue on a Windows machine, and it is not reproducible from my side. In order to proceed further,

  1. Share the .ballerina folder
  2. Share the jps when there is the slowness
  3. Backup the .ballerina folder and start again

@niveathika
Copy link
Contributor Author

niveathika commented May 15, 2025

  1. Share the .ballerina folder

Shared

  1. Share the jps when there is the slowness

Setup the profiler and will get a snapshot when I encounter this again

  1. Backup the .ballerina folder and start again

Sure. will start back with clean cache

@niveathika
Copy link
Contributor Author

@KavinduZoysa I was able to reproduce this. This seems to happen when one of the dependency cache is corrupted. In my case it was locally published cache.

Image

Image

Image

Shared the jps separately.

@KavinduZoysa
Copy link
Contributor

KavinduZoysa commented May 15, 2025

We have analysed the shared JPS files. According to them, there was no clue of slowness on the LS.

Once we run the LS based on the shared .ballerina folder, we can see the following error, which is the same as in the above comment.

Image

Since the LS is crashed at this moment, there were no suggestions, error highlighting, etc, at all.

We will further analyse this error and handle, so as not to crash the LS.

Edited:
LS is not crashed at this moment, it catches the error and sends it to the client side.

@KavinduZoysa
Copy link
Contributor

Since a bala file in the repository has crashed, LS is unable to compile the source. It throws an error at this point. Since the compilation fails, LS is unable to proceed, and because of that, LS features are not working.

Furthermore, LS handles the error without crashing itself. Also bal build command fails.

I think we need to prevent adding invalid bala files to the repository. @hasithaa WDYT?

@hasithaa
Copy link
Contributor

@KavinduZoysa: Preventing the addition of invalid Bala files will fix the issue. However, there can be scenarios where Bala files get corrupted even when downloaded from Central. Therefore, the compiler API needs to handle this gracefully.

@azinneera: Since the LS doesn't have control over invalid Bala files, can we handle this scenario gracefully from the compiler APIs?

@azinneera
Copy link
Contributor

@KavinduZoysa: Preventing the addition of invalid Bala files will fix the issue. However, there can be scenarios where Bala files get corrupted even when downloaded from Central. Therefore, the compiler API needs to handle this gracefully.

@azinneera: Since the LS doesn't have control over invalid Bala files, can we handle this scenario gracefully from the compiler APIs?

@hasithaa When the bala is downloaded, it is downloaded to a temporary location, and only if the download and the hash verification is successful, we copy it to the dedicated cache location. Corrupted/invalid .bala files are ignored this way. During the next compilation, the cache generation will happen again.

@KavinduZoysa, can we debug further and see what exactly makes the bala invalid?

@KavinduZoysa
Copy link
Contributor

@azinneera, at this point we expect to have la ist of source files in the bala path. But it is empty.

@azinneera azinneera self-assigned this May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants