-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
add startup benchmark #2195
add startup benchmark #2195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for contributing!
It appears that you have changed the framework code, but the tests that verify your change are missing. Could you please add them?
schema[field] = built | ||
} | ||
return schema | ||
}, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are currently 2 fields and there is an if
for one of them. Could you please remove the reduce?
schema.prop(`random-${prop}-${Math.round(Math.random() * 1000)}`, typeGen.next().value) | ||
} | ||
|
||
const built = schema.valueOf() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should fluent-schema be part of the bench?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid testing fluent-schema also since not all the users use it and it could impact the results (a little bit)
return lastSchema | ||
} | ||
|
||
function * getSchemaType () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of a generator!
Please rebase this pr against the new |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Dear stalebot, I will complete this PR soon 🤣 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
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. |
Starting from #2179 : it would be interesting adding a startup bench to check improvements to this phase. For example, I'm really curious to verify in
next
the changes made on the validation flow since the boost exists only in theory right now.This is a quick demo that generates random schemas as the worst case in the universe, but we should define a set of "common used" schemas to tests, so I think we should define these tests:
body
andY
forresponse
using shared schemabody
andY
forresponse
without using shared schemaWDYT?
Checklist
npm run test
andnpm run benchmark