-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add benchmark for graphql-tools-mocking #5
base: main
Are you sure you want to change the base?
Conversation
Add information about issues with arguments.
This will allow us to test the performance of the system with different schema sizes.
This is for graphql-tools-mocking setup.
Specs: MacBook Pro (16-inch, 2021) Chip Apple M1 Pro Memory 32 GB
Specs: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz Memory 64 GB
@@ -0,0 +1,5 @@ | |||
| Command | Mean [s] | Min [s] | Max [s] | Relative | |
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 know these generated files will cause issues with linting, but I'm not sure if we want to commit them or not.
On one hand it will be easier to reference/point to the data, on the other it is generated and thus not needed to be part of the repo.
$ hyperfine --warmup 3 -r 10 \ | ||
'ts-node -T graphql-tools-mocking/benchmark.ts graphql-tools-mocking.graphql' \ | ||
'ts-node -T graphql-tools-mocking/benchmark.ts <api-1>.graphql' \ | ||
'ts-node -T graphql-tools-mocking/benchmark.ts <api-2>.graphql' \ | ||
--export-markdown benchmark-result-<architecture>-<with-server/without-server>.md |
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.
What exactly are we measuring? Is it time to boot + mock 1 query?
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.
yes, in this case it is warm boot tho. The point here was not to measure the performance of mocking 1 query, but test the performance impact of big schemas and, as they grow, will this cause problems for our development productivity.
This will allow us to test the performance of the system with different
schema sizes.
Benchmarks
Benchmarks attached in the PR for ts-web and v-web on multiple scenarios/environments.
There isn't much difference on booting with GQL server or without, thus it shouldn't be a decision maker.
Documentation added on how to run these benchmarks.
Linux benchmarks:
ts-node -T graphql-tools-mocking/benchmark.ts graphql-tools-mocking.graphql
ts-node -T graphql-tools-mocking/benchmark.ts ts-deco-fe.federated.graphql
ts-node -T graphql-tools-mocking/benchmark.ts voyager-api.federated.graphql
Macbook Pro with M1 Pro CPU:
ts-node -T graphql-tools-mocking/benchmark.ts graphql-tools-mocking.graphql
ts-node -T graphql-tools-mocking/benchmark.ts ts-deco-fe.federated.graphql
ts-node -T graphql-tools-mocking/benchmark.ts voyager-api.federated.graphql