Skip to content

Commit 1f695da

Browse files
committed
benchmark: test perfomance cost of recreating schema
Nessary as part of a current and possible future disscussion on perfomance penalties of schema transformation.
1 parent 75635f0 commit 1f695da

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

benchmark/GraphQLSchema-benchmark.js

Lines changed: 15 additions & 0 deletions
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)