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

add startup benchmark #2195

Closed
wants to merge 1 commit into from
Closed

add startup benchmark #2195

wants to merge 1 commit into from

Conversation

Eomm
Copy link
Member

@Eomm Eomm commented Apr 12, 2020

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:

  • app with X routes without schema
  • app with X routes and X schema for body and Y for response using shared schema
  • app with X routes and X schema for body and Y for response without using shared schema
  • more?

WDYT?

Checklist

  • run npm run test and npm run benchmark
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message and code follows Code of conduct

@Eomm Eomm added the chore Small changes or internal project maintenance label Apr 12, 2020
Copy link

@tests-checker tests-checker bot left a 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
}, {})
Copy link
Member

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()
Copy link
Member

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?

Copy link
Member Author

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 () {
Copy link
Member

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!

@delvedor delvedor closed this Apr 13, 2020
@delvedor
Copy link
Member

Please rebase this pr against the new master branch, see #2056 (comment).

@delvedor delvedor reopened this Apr 13, 2020
@stale
Copy link

stale bot commented Apr 29, 2020

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.

@stale stale bot added the stale Issue or pr with more than 15 days of inactivity. label Apr 29, 2020
@Eomm
Copy link
Member Author

Eomm commented Apr 29, 2020

Dear stalebot, I will complete this PR soon 🤣

@stale stale bot removed the stale Issue or pr with more than 15 days of inactivity. label Apr 29, 2020
@stale
Copy link

stale bot commented May 15, 2020

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.

@stale stale bot added the stale Issue or pr with more than 15 days of inactivity. label May 15, 2020
@stale stale bot closed this May 22, 2020
@github-actions
Copy link

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 Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chore Small changes or internal project maintenance stale Issue or pr with more than 15 days of inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants