Skip to content

implement parallel schema loading#2575

Open
Kosta-Github wants to merge 1 commit intoajv-validator:masterfrom
Kosta-Github:parallel-schema-loading
Open

implement parallel schema loading#2575
Kosta-Github wants to merge 1 commit intoajv-validator:masterfrom
Kosta-Github:parallel-schema-loading

Conversation

@Kosta-Github
Copy link

What issue does this pull request resolve?

speed up the loading process of external $refs if a schema contains a lot of them

What changes did you make?

implement parallel schema loading

  • introduce a new flag enableParallelLoading
  • defaults to false to keep existing sequential behavior
  • when enabled the full schema gets scanned first for all external $refs and all missing $refs are loaded in parallel with Promise.allSettled()
  • this can speed up the loading process considerably for schemas that have a lot of external $refs
  • the existing and the new behavior are both covered by corresponding unit tests
  • documentation has been updated in various places as well

Is there anything that requires more attention while reviewing?

No

* introduce a new flag `enableParallelLoading`
* defaults to `false` to keep existing sequential behavior
* when enabled the full schema gets scanned first for all external `$refs` and all missing `$refs` are loaded in parallel with `Promise.allSettled()`
* this can speed up the loading process considerably for schemas that have a lot of external `$refs`
* the existing and the new behavior are both covered by corresponding unit tests
* documentation has been updated in various places as well
@Kosta-Github
Copy link
Author

The build is failing within the npm install step. But I haven't changed any of the dependencies in this PR and therefore the issue should be unrelated to this PR.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant