-
Notifications
You must be signed in to change notification settings - Fork 32.3k
[json] schema Validation/Intellisense very slow when JSON deep and Schema Complex #42679
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
Comments
@hipstersmoothie Any chance you can share the schema or a similar example? |
@aeschli I will try to get a sharable example going tomorrow! |
Sorry for the wait! @aeschli I have made a private repo and shared it with you. https://github.com/hipstersmoothie/schema/invitations |
I have also provided a test file which shows the slowness |
Thanks a lot for the example, and sorry for the wait. Each node can have have multiple alternatives. When testing which alternative to use we test the full object, including children and children's children. Each child type again has many alternatives. To make this more performant we need to avoid validating children if we see that we are of the wrong type. |
@aeschli is there any chance of progress on this? I don't have the experience to fix it myself but it's very impactful on us working with a similarly complex and recursive schema. We have to fall back to regularly validating with ajv or similar while writing documents when vscode is no longer suitable. I've got an example for you here of the schema; homebrew.json is the base document, entry.json is the part that recurses. |
@revilowaldow Sorry, there is currently no time budget for working on this. |
In my project we design an API that allows people to define web pages in json using a bunch of nested components. We have schema files for all components and how to combine them. When merged into 1 schema file it becomes around 7000 lines long.
I am noticing a huge slowdown when a file has JSON that is relatively deep.
Here is what it looks like when the depth is still okay

And here is what it looks like when a deep component is defined in the same file

Steps to Reproduce:
Is it possible to just turn off JSON validation and keep the Intellisense? Or just validate on file save? Could we show Intellisense suggestions before validation happens?
Also, when i am editing 2 JSON files the slowness is shared by the two. Even after closing the file that made everything slow, I still have to wait for some validation thing to finish before it realized the file is closed and updates the UI
If needed I can try to reproduce this bug with generic schema files.
What seems to be the issue is when i have a Collection component. This component can hold any other component, including more nested collections. If I nest a bunch of collections the problem presents itself.
Does this issue occur when all extensions are disabled?: Yes/No
Yes
The text was updated successfully, but these errors were encountered: