microsoft / microsoft/vscode-json-languageservice

Performance with recursion

Open
#92 2 comments 1 reaction 1 assignee View on GitHub

@aeschli is already working on this.

Since Oct 25, 2021.

bug performance
Dominant language
TypeScript
Stars
326
Forks
145
Avg merge
22h 10m
Merged PRs (30d)
9

Description

When the schema reuse recursively 2-3 level, there is a big performance issue.

The vscode json service just freeze for 20+ seconds to parse the data. Normally it is < 2 seconds.

Here is a repro:

https://github.com/justland/just-func/blob/json-perf/json-schema-specs/draft-07-core/let.jsonc

The data causing problem is this one:

      [
        "str",
        "Hello ",
        [
          "if",
          [
            "===",
            "male",
            [
              "ret",
              "gender"
            ]
          ],
          "Mr. ",
          "Mrs "
        ],
        [
          "ret",
          "name"
        ]
      ]

At the deepest (===) it is 4 level dep using the same schema.

You can find the json schema here:
https://github.com/justland/just-func/blob/json-perf/json-schema-specs/draft-07-core-specs.jsonc

which references this schema:
https://github.com/justland/just-func/blob/json-perf/json-schema/just-func.jsonc

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.