Skip to content

Commit c7d7026

Browse files
benchmark: test performance cost of re-creating schema (#3596)
1 parent b97fe0a commit c7d7026

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

benchmark/GraphQLSchema-benchmark.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { GraphQLSchema } from 'graphql/type/schema.js';
2+
import { buildClientSchema } from 'graphql/utilities/buildClientSchema.js';
3+
4+
import { bigSchemaIntrospectionResult } from './fixtures.js';
5+
6+
const bigSchema = buildClientSchema(bigSchemaIntrospectionResult.data);
7+
8+
export const benchmark = {
9+
name: 'Recreate a GraphQLSchema',
10+
count: 40,
11+
measure() {
12+
// eslint-disable-next-line no-new
13+
new GraphQLSchema(bigSchema.toConfig());
14+
},
15+
};

0 commit comments

Comments
 (0)