-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
benchmark: extract benchmarks into separate folder and run them on NP…
…M package
- Loading branch information
1 parent
3aad20b
commit 6073452
Showing
26 changed files
with
266 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
/coverage | ||
/npmDist | ||
/denoDist | ||
/benchmarkDist | ||
/npm | ||
/deno | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,5 @@ | |
/coverage | ||
/npmDist | ||
/denoDist | ||
/benchmarkDist | ||
/npm | ||
/deno |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
/coverage | ||
/npmDist | ||
/denoDist | ||
/benchmarkDist | ||
/npm | ||
/deno | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
const { parse } = require('graphql/language/parser.js'); | ||
const { buildASTSchema } = require('graphql/utilities/buildASTSchema.js'); | ||
|
||
const { bigSchemaSDL } = require('./fixtures.js'); | ||
|
||
const schemaAST = parse(bigSchemaSDL); | ||
|
||
module.exports = { | ||
name: 'Build Schema from AST', | ||
count: 10, | ||
measure() { | ||
buildASTSchema(schemaAST, { assumeValid: true }); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
const { buildClientSchema } = require('graphql/utilities/buildClientSchema.js'); | ||
|
||
const { bigSchemaIntrospectionResult } = require('./fixtures.js'); | ||
|
||
module.exports = { | ||
name: 'Build Schema from Introspection', | ||
count: 10, | ||
measure() { | ||
buildClientSchema(bigSchemaIntrospectionResult.data, { assumeValid: true }); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
exports.bigSchemaSDL = fs.readFileSync( | ||
path.join(__dirname, 'github-schema.graphql'), | ||
'utf8', | ||
); | ||
|
||
exports.bigSchemaIntrospectionResult = JSON.parse( | ||
fs.readFileSync(path.join(__dirname, 'github-schema.json'), 'utf8'), | ||
); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const { parse } = require('graphql/language/parser.js'); | ||
const { executeSync } = require('graphql/execution/execute.js'); | ||
const { buildSchema } = require('graphql/utilities/buildASTSchema.js'); | ||
const { | ||
getIntrospectionQuery, | ||
} = require('graphql/utilities/getIntrospectionQuery.js'); | ||
|
||
const { bigSchemaSDL } = require('./fixtures.js'); | ||
|
||
const schema = buildSchema(bigSchemaSDL, { assumeValid: true }); | ||
const document = parse(getIntrospectionQuery()); | ||
|
||
module.exports = { | ||
name: 'Execute Introspection Query', | ||
count: 10, | ||
measure() { | ||
executeSync({ schema, document }); | ||
}, | ||
}; |
Oops, something went wrong.