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

Performance issue in used yaml parser makes usage prohibitively slow #1063

Open
2 of 3 tasks
flo-bue opened this issue Oct 15, 2024 · 0 comments
Open
2 of 3 tasks

Performance issue in used yaml parser makes usage prohibitively slow #1063

flo-bue opened this issue Oct 15, 2024 · 0 comments

Comments

@flo-bue
Copy link

flo-bue commented Oct 15, 2024

I just started recently using your extension and was quite pleased by the YAML language support it offers inside VScode.
Unfortunately, as I progressed with my project, my YAML files got slightly longer and I realized that your extension seems to run into some performance issues. Especially the extensive use of anchors/aliases is not viable after the file reaches certain length. Code completion will take several seconds to load, schema suggestions won't load in a timely manner etc.
This makes the extension and its features as it is unusable for me.

I did some research and figured out that the yaml parser this extension is using is rather slow in parsing yaml files with anchors/aliases in them. This is a known issue https://github.com/eemeli/yaml/issues/537 of this parser that has not been addressed yet.
I did a similar performance comparison as described in this issue with my file and could confirm that the here used yaml parser by eemeli is more than an order of magnitude slower than the js-yaml parser.

The performance issue was therefore introduced by switching to the new parser that took place after suggested by its author in this issue: https://github.com/redhat-developer/yaml-language-server/issues/421

Using the outdated version 0.23.0 of vscode-yaml is for now my solution to still being able to handle my large yaml files and have at least some efficient language support. Of course, this comes with many downsides, as this version goes back several years. It would be great to have an efficient working vscode-yaml extension including the latest features.

Steps to Reproduce

  1. Have a larger yaml file (5k lines) including around 50 anchors/aliases
  2. Have a schema defining the structure of the above file
  3. Try to use code completions/aliases/schema validation

Environment

  • Windows
  • Mac
  • Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant