Skip to content

Slow schema validation on large oneOf blocks #246

Open

Description

The validation is very slow when having a large oneOf block in the schema with lots of elements in the matching json file

video.mp4

From testing this seems to be the problem (removing this makes the completion instant)

for (const error of this.problems) {
if (error.code === ErrorCode.EnumValueMismatch) {
error.message = l10n.t('Value is not accepted. Valid values: {0}.', this.enumValues.map(v => JSON.stringify(v)).join(', '));
}
}

JavaScript Profile:

vscode-profile-2024-10-09-11-23-02.cpuprofile

Example schema with 500-1000 oneOfs and the json file:

desktop-schema.json
base.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions