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

perf: store metadata in maps instead of arrays #1825

Merged
merged 2 commits into from
Dec 3, 2022

Conversation

NoNameProvided
Copy link
Member

Description

From the original PR:

This optimizes the performance of all validations and closes #343.

For example in my company we have 50+ complex models so MetadatStorage.validationMetadatas is array of ~5000 elements, MetadatStorage.constraintMetadatas is an array of 2500 elements. The validator loops over these arrays multiple times, so it takes 5+ seconds to validate a batch of 550 objects.

Checklist

  • the pull request title describes what this PR does (not a vague title like Update index.md)
  • the pull request targets the default branch of the repository (develop)
  • the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • tests are added for the changes I made (if any source code was modified)
  • documentation added or updated
  • I have run the project locally and verified that there are no errors

Fixes

references #343

Copy link
Contributor

@Clashsoft Clashsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoNameProvided NoNameProvided force-pushed the fix/nested-validation-optimization branch from 8d576ec to 38b818a Compare December 3, 2022 12:36
@NoNameProvided NoNameProvided merged commit f0541a6 into develop Dec 3, 2022
@NoNameProvided NoNameProvided deleted the fix/nested-validation-optimization branch December 3, 2022 12:39
@github-actions
Copy link

github-actions bot commented Jan 3, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

perf: nested validation is slow
3 participants