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

code-gen: inline basic validators #521

Merged
merged 1 commit into from Nov 28, 2020
Merged

code-gen: inline basic validators #521

merged 1 commit into from Nov 28, 2020

Conversation

dirkdev98
Copy link
Member

For now we almost always inline references, and string or number oneOf types.

Closes #508

For now we almost always inline references, and string or number oneOf types.

Closes #508
@github-actions
Copy link
Contributor

==== C8 test coverage ====
Statements: 70.64% ( 18005/25488 )
Branches : 71.56% ( 2083 /2911 )
Functions : 70.17% ( 647 /922 )
Lines : 70.64% ( 18005 /25488 )

@github-actions
Copy link
Contributor

==== Benchmark result ====

Node.js version: 14
Total benchmarks: 13
          Passed: 13
          Failed: 0
-----------
lbu validator simple                    5000000  iterations      442  ns/op
yup validator simple                     100000  iterations    11692  ns/op
fastest-validator validator simple     10000000  iterations      116  ns/op
lbu validator nested                      50000  iterations    41619  ns/op
yup validator nested                      10000  iterations   168400  ns/op
fastest-validator validator nested      2000000  iterations      822  ns/op
logger - strings                         500000  iterations     2191  ns/op
logger - objects                         500000  iterations     2669  ns/op
logger - deep objects                    500000  iterations     4608  ns/op
uuid                                    2000000  iterations      526  ns/op
uuid.isValid                           10000000  iterations      123  ns/op
isNil                                 500000000  iterations        0  ns/op
isPlainObject                         100000000  iterations       16  ns/op

@github-actions
Copy link
Contributor

==== Benchmark result ====

Node.js version: 15
Total benchmarks: 13
          Passed: 13
          Failed: 0
-----------
lbu validator simple                    5000000  iterations      496  ns/op
yup validator simple                     100000  iterations    12701  ns/op
fastest-validator validator simple     10000000  iterations      136  ns/op
lbu validator nested                      50000  iterations    46460  ns/op
yup validator nested                      10000  iterations   171476  ns/op
fastest-validator validator nested      2000000  iterations      865  ns/op
logger - strings                         500000  iterations     2407  ns/op
logger - objects                         500000  iterations     2702  ns/op
logger - deep objects                    500000  iterations     4138  ns/op
uuid                                    2000000  iterations      614  ns/op
uuid.isValid                           10000000  iterations      173  ns/op
isNil                                 500000000  iterations        0  ns/op
isPlainObject                         100000000  iterations       19  ns/op

@dirkdev98 dirkdev98 merged commit 6ccbae4 into main Nov 28, 2020
@dirkdev98 dirkdev98 deleted the feat/inline-validators branch November 28, 2020 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

code-gen: inline simple validators
1 participant