@graphitation/supermassive 3.9.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -1
- package/CHANGELOG.md +10 -2
- package/lib/__testUtils__/execute.js +77 -121
- package/lib/__testUtils__/execute.js.map +1 -1
- package/lib/__testUtils__/execute.mjs +77 -124
- package/lib/__testUtils__/execute.mjs.map +1 -1
- package/lib/benchmarks/index.js +41 -63
- package/lib/benchmarks/index.js.map +1 -1
- package/lib/benchmarks/index.mjs +152 -184
- package/lib/benchmarks/index.mjs.map +1 -1
- package/lib/benchmarks/nice-benchmark.js +3 -23
- package/lib/benchmarks/nice-benchmark.js.map +1 -1
- package/lib/benchmarks/nice-benchmark.mjs +3 -24
- package/lib/benchmarks/nice-benchmark.mjs.map +1 -1
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.js +78 -68
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.js.map +1 -1
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs +78 -71
- package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs.map +1 -1
- package/lib/benchmarks/swapi-schema/resolvers.js +31 -71
- package/lib/benchmarks/swapi-schema/resolvers.js.map +1 -1
- package/lib/benchmarks/swapi-schema/resolvers.mjs +31 -74
- package/lib/benchmarks/swapi-schema/resolvers.mjs.map +1 -1
- package/lib/executeWithoutSchema.js +199 -248
- package/lib/executeWithoutSchema.js.map +1 -1
- package/lib/executeWithoutSchema.mjs +199 -251
- package/lib/executeWithoutSchema.mjs.map +1 -1
- package/lib/legacyAST/addTypesToRequestDocument.js +6 -21
- package/lib/legacyAST/addTypesToRequestDocument.js.map +1 -1
- package/lib/legacyAST/addTypesToRequestDocument.mjs +6 -24
- package/lib/legacyAST/addTypesToRequestDocument.mjs.map +1 -1
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.js +9 -23
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.js.map +1 -1
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.mjs +9 -26
- package/lib/utilities/addMinimalViableSchemaToRequestDocument.mjs.map +1 -1
- package/lib/utilities/mapAsyncIterator.js +19 -47
- package/lib/utilities/mapAsyncIterator.js.map +1 -1
- package/lib/utilities/mapAsyncIterator.mjs +19 -48
- package/lib/utilities/mapAsyncIterator.mjs.map +1 -1
- package/package.json +1 -1
package/lib/benchmarks/index.js
CHANGED
|
@@ -21,26 +21,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
|
-
var __async = (__this, __arguments, generator) => {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
var fulfilled = (value) => {
|
|
27
|
-
try {
|
|
28
|
-
step(generator.next(value));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var rejected = (value) => {
|
|
34
|
-
try {
|
|
35
|
-
step(generator.throw(value));
|
|
36
|
-
} catch (e) {
|
|
37
|
-
reject(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
24
|
var import_fs = __toESM(require("fs"));
|
|
45
25
|
var import_path = __toESM(require("path"));
|
|
46
26
|
var import_nice_benchmark = __toESM(require("./nice-benchmark"));
|
|
@@ -69,8 +49,8 @@ const schemaFragment = {
|
|
|
69
49
|
resolvers: import_resolvers.default
|
|
70
50
|
};
|
|
71
51
|
const queryRunningSuite = new import_nice_benchmark.default("Query Running");
|
|
72
|
-
queryRunningSuite.add("graphql-js - string queries", () =>
|
|
73
|
-
const result =
|
|
52
|
+
queryRunningSuite.add("graphql-js - string queries", async () => {
|
|
53
|
+
const result = await (0, import_graphql.execute)({
|
|
74
54
|
schema: import_swapi_schema.default,
|
|
75
55
|
document: (0, import_graphql.parse)(query),
|
|
76
56
|
contextValue: { models: import_models.default }
|
|
@@ -78,9 +58,9 @@ queryRunningSuite.add("graphql-js - string queries", () => __async(exports, null
|
|
|
78
58
|
if (result.errors || !result.data) {
|
|
79
59
|
throw new Error("Stuff ain't executing");
|
|
80
60
|
}
|
|
81
|
-
})
|
|
82
|
-
queryRunningSuite.add("graphql-js - parsed queries", () =>
|
|
83
|
-
const result =
|
|
61
|
+
});
|
|
62
|
+
queryRunningSuite.add("graphql-js - parsed queries", async () => {
|
|
63
|
+
const result = await (0, import_graphql.execute)({
|
|
84
64
|
schema: import_swapi_schema.default,
|
|
85
65
|
document: parsedQuery,
|
|
86
66
|
contextValue: { models: import_models.default }
|
|
@@ -88,30 +68,30 @@ queryRunningSuite.add("graphql-js - parsed queries", () => __async(exports, null
|
|
|
88
68
|
if (result.errors || !result.data) {
|
|
89
69
|
throw new Error("Stuff ain't executing");
|
|
90
70
|
}
|
|
91
|
-
})
|
|
92
|
-
queryRunningSuite.add("graphql-jit - uncompiled", () =>
|
|
71
|
+
});
|
|
72
|
+
queryRunningSuite.add("graphql-jit - uncompiled", async () => {
|
|
93
73
|
const freshCompiledQuery = (0, import_graphql_jit.compileQuery)(import_swapi_schema.default, parsedQuery);
|
|
94
74
|
if ((0, import_graphql_jit.isCompiledQuery)(freshCompiledQuery)) {
|
|
95
|
-
const result =
|
|
75
|
+
const result = await freshCompiledQuery.query({}, { models: import_models.default }, {});
|
|
96
76
|
if (result.errors || !result.data) {
|
|
97
77
|
throw new Error("Stuff ain't executing");
|
|
98
78
|
}
|
|
99
79
|
} else {
|
|
100
80
|
throw new Error("Wrong query");
|
|
101
81
|
}
|
|
102
|
-
})
|
|
103
|
-
queryRunningSuite.add("graphql-jit - precompiled", () =>
|
|
82
|
+
});
|
|
83
|
+
queryRunningSuite.add("graphql-jit - precompiled", async () => {
|
|
104
84
|
if ((0, import_graphql_jit.isCompiledQuery)(compiledQuery)) {
|
|
105
|
-
const result =
|
|
85
|
+
const result = await compiledQuery.query({}, { models: import_models.default }, {});
|
|
106
86
|
if (result.errors || !result.data) {
|
|
107
87
|
throw new Error("Stuff ain't executing");
|
|
108
88
|
}
|
|
109
89
|
} else {
|
|
110
90
|
throw new Error("Wrong query");
|
|
111
91
|
}
|
|
112
|
-
})
|
|
113
|
-
queryRunningSuite.add("supermassive - runtime schemaless", () =>
|
|
114
|
-
const result =
|
|
92
|
+
});
|
|
93
|
+
queryRunningSuite.add("supermassive - runtime schemaless", async () => {
|
|
94
|
+
const result = await (0, import_executeWithoutSchema.executeWithoutSchema)({
|
|
115
95
|
schemaFragment,
|
|
116
96
|
document: parsedQuery,
|
|
117
97
|
contextValue: { models: import_models.default }
|
|
@@ -119,11 +99,11 @@ queryRunningSuite.add("supermassive - runtime schemaless", () => __async(exports
|
|
|
119
99
|
if ("data" in result && (result.errors || !result.data)) {
|
|
120
100
|
throw new Error("Stuff ain't executing");
|
|
121
101
|
}
|
|
122
|
-
})
|
|
102
|
+
});
|
|
123
103
|
queryRunningSuite.add(
|
|
124
104
|
"supermassive - before operation execute sync hook - runtime schemaless",
|
|
125
|
-
() =>
|
|
126
|
-
const result =
|
|
105
|
+
async () => {
|
|
106
|
+
const result = await (0, import_executeWithoutSchema.executeWithoutSchema)({
|
|
127
107
|
schemaFragment,
|
|
128
108
|
document: parsedQuery,
|
|
129
109
|
fieldExecutionHooks: {
|
|
@@ -136,30 +116,30 @@ queryRunningSuite.add(
|
|
|
136
116
|
if ("data" in result && (result.errors || !result.data)) {
|
|
137
117
|
throw new Error("Stuff ain't executing");
|
|
138
118
|
}
|
|
139
|
-
}
|
|
119
|
+
}
|
|
140
120
|
);
|
|
141
121
|
queryRunningSuite.add(
|
|
142
122
|
"supermassive - before operation execute async hook - runtime schemaless",
|
|
143
|
-
() =>
|
|
144
|
-
const result =
|
|
123
|
+
async () => {
|
|
124
|
+
const result = await (0, import_executeWithoutSchema.executeWithoutSchema)({
|
|
145
125
|
schemaFragment,
|
|
146
126
|
document: parsedQuery,
|
|
147
127
|
fieldExecutionHooks: {
|
|
148
|
-
beforeOperationExecute:
|
|
128
|
+
beforeOperationExecute: async ({ context }) => {
|
|
149
129
|
context.test = 0;
|
|
150
|
-
}
|
|
130
|
+
}
|
|
151
131
|
},
|
|
152
132
|
contextValue: { models: import_models.default }
|
|
153
133
|
});
|
|
154
134
|
if ("data" in result && (result.errors || !result.data)) {
|
|
155
135
|
throw new Error("Stuff ain't executing");
|
|
156
136
|
}
|
|
157
|
-
}
|
|
137
|
+
}
|
|
158
138
|
);
|
|
159
139
|
queryRunningSuite.add(
|
|
160
140
|
"supermassive - before field resolve sync hook - runtime schemaless",
|
|
161
|
-
() =>
|
|
162
|
-
const result =
|
|
141
|
+
async () => {
|
|
142
|
+
const result = await (0, import_executeWithoutSchema.executeWithoutSchema)({
|
|
163
143
|
schemaFragment,
|
|
164
144
|
document: parsedQuery,
|
|
165
145
|
fieldExecutionHooks: {
|
|
@@ -172,44 +152,42 @@ queryRunningSuite.add(
|
|
|
172
152
|
if ("data" in result && (result.errors || !result.data)) {
|
|
173
153
|
throw new Error("Stuff ain't executing");
|
|
174
154
|
}
|
|
175
|
-
}
|
|
155
|
+
}
|
|
176
156
|
);
|
|
177
157
|
queryRunningSuite.add(
|
|
178
158
|
"supermassive - before field resolve async hook - runtime schemaless",
|
|
179
|
-
() =>
|
|
180
|
-
const result =
|
|
159
|
+
async () => {
|
|
160
|
+
const result = await (0, import_executeWithoutSchema.executeWithoutSchema)({
|
|
181
161
|
schemaFragment,
|
|
182
162
|
document: parsedQuery,
|
|
183
163
|
fieldExecutionHooks: {
|
|
184
|
-
beforeFieldResolve:
|
|
164
|
+
beforeFieldResolve: async ({ context }) => {
|
|
185
165
|
context.test = 0;
|
|
186
|
-
}
|
|
166
|
+
}
|
|
187
167
|
},
|
|
188
168
|
contextValue: { models: import_models.default }
|
|
189
169
|
});
|
|
190
170
|
if ("data" in result && (result.errors || !result.data)) {
|
|
191
171
|
throw new Error("Stuff ain't executing");
|
|
192
172
|
}
|
|
193
|
-
}
|
|
173
|
+
}
|
|
194
174
|
);
|
|
195
175
|
const queryParsingSuite = new import_nice_benchmark.default("Query parsing");
|
|
196
|
-
queryParsingSuite.add("graphql-js", () =>
|
|
176
|
+
queryParsingSuite.add("graphql-js", async () => {
|
|
197
177
|
(0, import_graphql.parse)(query);
|
|
198
|
-
})
|
|
178
|
+
});
|
|
199
179
|
const queryCompilingSuite = new import_nice_benchmark.default("Query compiling");
|
|
200
|
-
queryCompilingSuite.add("graphql-jit", () =>
|
|
201
|
-
|
|
202
|
-
})
|
|
180
|
+
queryCompilingSuite.add("graphql-jit", async () => {
|
|
181
|
+
await (0, import_graphql_jit.compileQuery)(import_swapi_schema.default, parsedQuery);
|
|
182
|
+
});
|
|
203
183
|
const queryAnnotationSuite = new import_nice_benchmark.default("Query annotation");
|
|
204
184
|
queryAnnotationSuite.add("supermassive", () => {
|
|
205
185
|
(0, import_extractMinimalViableSchemaForRequestDocument.extractMinimalViableSchemaForRequestDocument)(import_swapi_schema.default, parsedQuery);
|
|
206
186
|
});
|
|
207
|
-
function main() {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
yield queryRunningSuite.run();
|
|
213
|
-
});
|
|
187
|
+
async function main() {
|
|
188
|
+
await queryCompilingSuite.run();
|
|
189
|
+
await queryParsingSuite.run();
|
|
190
|
+
await queryAnnotationSuite.run();
|
|
191
|
+
await queryRunningSuite.run();
|
|
214
192
|
}
|
|
215
193
|
main();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/benchmarks/index.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from \"fs\";\nimport path from \"path\";\nimport NiceBenchmark from \"./nice-benchmark\";\nimport schema from \"./swapi-schema\";\nimport resolvers from \"./swapi-schema/resolvers\";\nimport models from \"./swapi-schema/models\";\nimport {\n execute as graphqlExecute,\n parse,\n // experimentalExecuteIncrementally as graphqlExecute,\n} from \"graphql\";\nimport { compileQuery, isCompiledQuery } from \"graphql-jit\";\nimport { executeWithoutSchema as supermassiveExecute } from \"../executeWithoutSchema\";\nimport { UserResolvers, SchemaFragment } from \"../types\";\nimport { extractMinimalViableSchemaForRequestDocument } from \"../utilities/extractMinimalViableSchemaForRequestDocument\";\n\nconst query = fs.readFileSync(\n path.join(__dirname, \"./fixtures/query1.graphql\"),\n {\n encoding: \"utf-8\",\n },\n);\n\nconst parsedQuery = parse(query);\nconst compiledQuery = compileQuery(schema, parsedQuery);\n\nconst { definitions } = extractMinimalViableSchemaForRequestDocument(\n schema,\n parsedQuery,\n);\n\nconst schemaFragment: SchemaFragment = {\n schemaId: \"benchmark\",\n definitions,\n resolvers: resolvers as UserResolvers,\n};\n\nconst queryRunningSuite = new NiceBenchmark(\"Query Running\");\nqueryRunningSuite.add(\"graphql-js - string queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parse(query),\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-js - parsed queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parsedQuery,\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - uncompiled\", async () => {\n const freshCompiledQuery = compileQuery(schema, parsedQuery);\n if (isCompiledQuery(freshCompiledQuery)) {\n const result = await freshCompiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - precompiled\", async () => {\n if (isCompiledQuery(compiledQuery)) {\n const result = await compiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"supermassive - runtime schemaless\", async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\n\nqueryRunningSuite.add(\n \"supermassive - before operation execute sync hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeOperationExecute: ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nqueryRunningSuite.add(\n \"supermassive - before operation execute async hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeOperationExecute: async ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nqueryRunningSuite.add(\n \"supermassive - before field resolve sync hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeFieldResolve: ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nqueryRunningSuite.add(\n \"supermassive - before field resolve async hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeFieldResolve: async ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nconst queryParsingSuite = new NiceBenchmark(\"Query parsing\");\nqueryParsingSuite.add(\"graphql-js\", async () => {\n parse(query);\n});\n\nconst queryCompilingSuite = new NiceBenchmark(\"Query compiling\");\nqueryCompilingSuite.add(\"graphql-jit\", async () => {\n await compileQuery(schema, parsedQuery);\n});\n\nconst queryAnnotationSuite = new NiceBenchmark(\"Query annotation\");\nqueryAnnotationSuite.add(\"supermassive\", () => {\n extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);\n});\n\nasync function main() {\n await queryCompilingSuite.run();\n await queryParsingSuite.run();\n await queryAnnotationSuite.run();\n await queryRunningSuite.run();\n}\n\nmain();\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,gBAAe;AACf,kBAAiB;AACjB,4BAA0B;AAC1B,0BAAmB;AACnB,uBAAsB;AACtB,oBAAmB;AACnB,qBAIO;AACP,yBAA8C;AAC9C,kCAA4D;AAE5D,0DAA6D;AAE7D,MAAM,QAAQ,UAAAA,QAAG;AAAA,EACf,YAAAC,QAAK,KAAK,WAAW,2BAA2B;AAAA,EAChD;AAAA,IACE,UAAU;AAAA,EACZ;AACF;AAEA,MAAM,kBAAc,sBAAM,KAAK;AAC/B,MAAM,oBAAgB,iCAAa,oBAAAC,SAAQ,WAAW;AAEtD,MAAM,EAAE,YAAY,QAAI;AAAA,EACtB,oBAAAA;AAAA,EACA;AACF;AAEA,MAAM,iBAAiC;AAAA,EACrC,UAAU;AAAA,EACV;AAAA,EACA,WAAW,iBAAAC;AACb;AAEA,MAAM,oBAAoB,IAAI,sBAAAC,QAAc,eAAe;AAC3D,kBAAkB,IAAI,+BAA+B,YAAY;AAC/D,QAAM,SAAS,UAAM,eAAAC,SAAe;AAAA,IAClC,4BAAAH;AAAA,IACA,cAAU,sBAAM,KAAK;AAAA,IACrB,cAAc,EAAE,sBAAAI,QAAO;AAAA,EACzB,CAAC;AACD,MAAI,OAAO,UAAU,CAAC,OAAO,MAAM;AACjC,UAAM,IA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EACA,YAAY;AACV,UAAM,SAAS,UAAM,4BAAAC,sBAAoB;AAAA,MACvC;AAAA,MACA,UAAU;AAAA,MACV,qBAAqB;AAAA,QACnB,oBAAoB,OAAO,EAAE,QAAQ,MAAM;AACzC,UAAC,QAAgB,OAAO;AAAA,QAC1B;AAAA,MACF;AAAA,MACA,cAAc,EAAE,sBAAAD,QAAO;AAAA,IACzB,CAAC;AACD,QAAI,UAAU,WAAW,OAAO,UAAU,CAAC,OAAO,OAAO;AACvD,YAAM,IAAI,MAAM,uBAAuB;AAAA,IACzC;AAAA,EACF;AACF;AAEA,MAAM,oBAAoB,IAAI,sBAAAF,QAAc,eAAe;AAC3D,kBAAkB,IAAI,cAAc,YAAY;AAC9C,4BAAM,KAAK;AACb,CAAC;AAED,MAAM,sBAAsB,IAAI,sBAAAA,QAAc,iBAAiB;AAC/D,oBAAoB,IAAI,eAAe,YAAY;AACjD,YAAM,iCAAa,oBAAAF,SAAQ,WAAW;AACxC,CAAC;AAED,MAAM,uBAAuB,IAAI,sBAAAE,QAAc,kBAAkB;AACjE,qBAAqB,IAAI,gBAAgB,MAAM;AAC7C,wGAA6C,oBAAAF,SAAQ,WAAW;AAClE,CAAC;AAED,eAAe,OAAO;AACpB,QAAM,oBAAoB,IAAI;AAC9B,QAAM,kBAAkB,IAAI;AAC5B,QAAM,qBAAqB,IAAI;AAC/B,QAAM,kBAAkB,IAAI;AAC9B;AAEA,KAAK;",
|
|
6
6
|
"names": ["fs", "path", "schema", "resolvers", "NiceBenchmark", "graphqlExecute", "models", "supermassiveExecute"]
|
|
7
7
|
}
|
package/lib/benchmarks/index.mjs
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
-
};
|
|
5
|
-
var __async = (__this, __arguments, generator) => {
|
|
6
|
-
return new Promise((resolve, reject) => {
|
|
7
|
-
var fulfilled = (value) => {
|
|
8
|
-
try {
|
|
9
|
-
step(generator.next(value));
|
|
10
|
-
} catch (e) {
|
|
11
|
-
reject(e);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
var rejected = (value) => {
|
|
15
|
-
try {
|
|
16
|
-
step(generator.throw(value));
|
|
17
|
-
} catch (e) {
|
|
18
|
-
reject(e);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
22
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
|
|
26
1
|
// src/benchmarks/index.ts
|
|
27
2
|
import fs from "fs";
|
|
28
3
|
import path from "path";
|
|
@@ -37,170 +12,163 @@ import {
|
|
|
37
12
|
import { compileQuery, isCompiledQuery } from "graphql-jit";
|
|
38
13
|
import { executeWithoutSchema as supermassiveExecute } from "../executeWithoutSchema.mjs";
|
|
39
14
|
import { extractMinimalViableSchemaForRequestDocument } from "../utilities/extractMinimalViableSchemaForRequestDocument.mjs";
|
|
40
|
-
var
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
beforeOperationExecute: ({ context }) => {
|
|
119
|
-
context.test = 0;
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
contextValue: { models }
|
|
123
|
-
});
|
|
124
|
-
if ("data" in result && (result.errors || !result.data)) {
|
|
125
|
-
throw new Error("Stuff ain't executing");
|
|
15
|
+
var query = fs.readFileSync(
|
|
16
|
+
path.join(__dirname, "./fixtures/query1.graphql"),
|
|
17
|
+
{
|
|
18
|
+
encoding: "utf-8"
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
var parsedQuery = parse(query);
|
|
22
|
+
var compiledQuery = compileQuery(schema, parsedQuery);
|
|
23
|
+
var { definitions } = extractMinimalViableSchemaForRequestDocument(
|
|
24
|
+
schema,
|
|
25
|
+
parsedQuery
|
|
26
|
+
);
|
|
27
|
+
var schemaFragment = {
|
|
28
|
+
schemaId: "benchmark",
|
|
29
|
+
definitions,
|
|
30
|
+
resolvers
|
|
31
|
+
};
|
|
32
|
+
var queryRunningSuite = new NiceBenchmark("Query Running");
|
|
33
|
+
queryRunningSuite.add("graphql-js - string queries", async () => {
|
|
34
|
+
const result = await graphqlExecute({
|
|
35
|
+
schema,
|
|
36
|
+
document: parse(query),
|
|
37
|
+
contextValue: { models }
|
|
38
|
+
});
|
|
39
|
+
if (result.errors || !result.data) {
|
|
40
|
+
throw new Error("Stuff ain't executing");
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
queryRunningSuite.add("graphql-js - parsed queries", async () => {
|
|
44
|
+
const result = await graphqlExecute({
|
|
45
|
+
schema,
|
|
46
|
+
document: parsedQuery,
|
|
47
|
+
contextValue: { models }
|
|
48
|
+
});
|
|
49
|
+
if (result.errors || !result.data) {
|
|
50
|
+
throw new Error("Stuff ain't executing");
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
queryRunningSuite.add("graphql-jit - uncompiled", async () => {
|
|
54
|
+
const freshCompiledQuery = compileQuery(schema, parsedQuery);
|
|
55
|
+
if (isCompiledQuery(freshCompiledQuery)) {
|
|
56
|
+
const result = await freshCompiledQuery.query({}, { models }, {});
|
|
57
|
+
if (result.errors || !result.data) {
|
|
58
|
+
throw new Error("Stuff ain't executing");
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
throw new Error("Wrong query");
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
queryRunningSuite.add("graphql-jit - precompiled", async () => {
|
|
65
|
+
if (isCompiledQuery(compiledQuery)) {
|
|
66
|
+
const result = await compiledQuery.query({}, { models }, {});
|
|
67
|
+
if (result.errors || !result.data) {
|
|
68
|
+
throw new Error("Stuff ain't executing");
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
throw new Error("Wrong query");
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
queryRunningSuite.add("supermassive - runtime schemaless", async () => {
|
|
75
|
+
const result = await supermassiveExecute({
|
|
76
|
+
schemaFragment,
|
|
77
|
+
document: parsedQuery,
|
|
78
|
+
contextValue: { models }
|
|
79
|
+
});
|
|
80
|
+
if ("data" in result && (result.errors || !result.data)) {
|
|
81
|
+
throw new Error("Stuff ain't executing");
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
queryRunningSuite.add(
|
|
85
|
+
"supermassive - before operation execute sync hook - runtime schemaless",
|
|
86
|
+
async () => {
|
|
87
|
+
const result = await supermassiveExecute({
|
|
88
|
+
schemaFragment,
|
|
89
|
+
document: parsedQuery,
|
|
90
|
+
fieldExecutionHooks: {
|
|
91
|
+
beforeOperationExecute: ({ context }) => {
|
|
92
|
+
context.test = 0;
|
|
126
93
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
94
|
+
},
|
|
95
|
+
contextValue: { models }
|
|
96
|
+
});
|
|
97
|
+
if ("data" in result && (result.errors || !result.data)) {
|
|
98
|
+
throw new Error("Stuff ain't executing");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
queryRunningSuite.add(
|
|
103
|
+
"supermassive - before operation execute async hook - runtime schemaless",
|
|
104
|
+
async () => {
|
|
105
|
+
const result = await supermassiveExecute({
|
|
106
|
+
schemaFragment,
|
|
107
|
+
document: parsedQuery,
|
|
108
|
+
fieldExecutionHooks: {
|
|
109
|
+
beforeOperationExecute: async ({ context }) => {
|
|
110
|
+
context.test = 0;
|
|
144
111
|
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
112
|
+
},
|
|
113
|
+
contextValue: { models }
|
|
114
|
+
});
|
|
115
|
+
if ("data" in result && (result.errors || !result.data)) {
|
|
116
|
+
throw new Error("Stuff ain't executing");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
queryRunningSuite.add(
|
|
121
|
+
"supermassive - before field resolve sync hook - runtime schemaless",
|
|
122
|
+
async () => {
|
|
123
|
+
const result = await supermassiveExecute({
|
|
124
|
+
schemaFragment,
|
|
125
|
+
document: parsedQuery,
|
|
126
|
+
fieldExecutionHooks: {
|
|
127
|
+
beforeFieldResolve: ({ context }) => {
|
|
128
|
+
context.test = 0;
|
|
162
129
|
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
130
|
+
},
|
|
131
|
+
contextValue: { models }
|
|
132
|
+
});
|
|
133
|
+
if ("data" in result && (result.errors || !result.data)) {
|
|
134
|
+
throw new Error("Stuff ain't executing");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
queryRunningSuite.add(
|
|
139
|
+
"supermassive - before field resolve async hook - runtime schemaless",
|
|
140
|
+
async () => {
|
|
141
|
+
const result = await supermassiveExecute({
|
|
142
|
+
schemaFragment,
|
|
143
|
+
document: parsedQuery,
|
|
144
|
+
fieldExecutionHooks: {
|
|
145
|
+
beforeFieldResolve: async ({ context }) => {
|
|
146
|
+
context.test = 0;
|
|
180
147
|
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
var queryParsingSuite = new NiceBenchmark("Query parsing");
|
|
184
|
-
queryParsingSuite.add("graphql-js", () => __async(exports, null, function* () {
|
|
185
|
-
parse(query);
|
|
186
|
-
}));
|
|
187
|
-
var queryCompilingSuite = new NiceBenchmark("Query compiling");
|
|
188
|
-
queryCompilingSuite.add("graphql-jit", () => __async(exports, null, function* () {
|
|
189
|
-
yield compileQuery(schema, parsedQuery);
|
|
190
|
-
}));
|
|
191
|
-
var queryAnnotationSuite = new NiceBenchmark("Query annotation");
|
|
192
|
-
queryAnnotationSuite.add("supermassive", () => {
|
|
193
|
-
extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);
|
|
148
|
+
},
|
|
149
|
+
contextValue: { models }
|
|
194
150
|
});
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
yield queryCompilingSuite.run();
|
|
198
|
-
yield queryParsingSuite.run();
|
|
199
|
-
yield queryAnnotationSuite.run();
|
|
200
|
-
yield queryRunningSuite.run();
|
|
201
|
-
});
|
|
151
|
+
if ("data" in result && (result.errors || !result.data)) {
|
|
152
|
+
throw new Error("Stuff ain't executing");
|
|
202
153
|
}
|
|
203
|
-
main();
|
|
204
154
|
}
|
|
155
|
+
);
|
|
156
|
+
var queryParsingSuite = new NiceBenchmark("Query parsing");
|
|
157
|
+
queryParsingSuite.add("graphql-js", async () => {
|
|
158
|
+
parse(query);
|
|
159
|
+
});
|
|
160
|
+
var queryCompilingSuite = new NiceBenchmark("Query compiling");
|
|
161
|
+
queryCompilingSuite.add("graphql-jit", async () => {
|
|
162
|
+
await compileQuery(schema, parsedQuery);
|
|
163
|
+
});
|
|
164
|
+
var queryAnnotationSuite = new NiceBenchmark("Query annotation");
|
|
165
|
+
queryAnnotationSuite.add("supermassive", () => {
|
|
166
|
+
extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);
|
|
205
167
|
});
|
|
206
|
-
|
|
168
|
+
async function main() {
|
|
169
|
+
await queryCompilingSuite.run();
|
|
170
|
+
await queryParsingSuite.run();
|
|
171
|
+
await queryAnnotationSuite.run();
|
|
172
|
+
await queryRunningSuite.run();
|
|
173
|
+
}
|
|
174
|
+
main();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/benchmarks/index.ts"],
|
|
4
4
|
"sourcesContent": ["import fs from \"fs\";\nimport path from \"path\";\nimport NiceBenchmark from \"./nice-benchmark\";\nimport schema from \"./swapi-schema\";\nimport resolvers from \"./swapi-schema/resolvers\";\nimport models from \"./swapi-schema/models\";\nimport {\n execute as graphqlExecute,\n parse,\n // experimentalExecuteIncrementally as graphqlExecute,\n} from \"graphql\";\nimport { compileQuery, isCompiledQuery } from \"graphql-jit\";\nimport { executeWithoutSchema as supermassiveExecute } from \"../executeWithoutSchema\";\nimport { UserResolvers, SchemaFragment } from \"../types\";\nimport { extractMinimalViableSchemaForRequestDocument } from \"../utilities/extractMinimalViableSchemaForRequestDocument\";\n\nconst query = fs.readFileSync(\n path.join(__dirname, \"./fixtures/query1.graphql\"),\n {\n encoding: \"utf-8\",\n },\n);\n\nconst parsedQuery = parse(query);\nconst compiledQuery = compileQuery(schema, parsedQuery);\n\nconst { definitions } = extractMinimalViableSchemaForRequestDocument(\n schema,\n parsedQuery,\n);\n\nconst schemaFragment: SchemaFragment = {\n schemaId: \"benchmark\",\n definitions,\n resolvers: resolvers as UserResolvers,\n};\n\nconst queryRunningSuite = new NiceBenchmark(\"Query Running\");\nqueryRunningSuite.add(\"graphql-js - string queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parse(query),\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-js - parsed queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parsedQuery,\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - uncompiled\", async () => {\n const freshCompiledQuery = compileQuery(schema, parsedQuery);\n if (isCompiledQuery(freshCompiledQuery)) {\n const result = await freshCompiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - precompiled\", async () => {\n if (isCompiledQuery(compiledQuery)) {\n const result = await compiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"supermassive - runtime schemaless\", async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\n\nqueryRunningSuite.add(\n \"supermassive - before operation execute sync hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeOperationExecute: ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nqueryRunningSuite.add(\n \"supermassive - before operation execute async hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeOperationExecute: async ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nqueryRunningSuite.add(\n \"supermassive - before field resolve sync hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeFieldResolve: ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nqueryRunningSuite.add(\n \"supermassive - before field resolve async hook - runtime schemaless\",\n async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n fieldExecutionHooks: {\n beforeFieldResolve: async ({ context }) => {\n (context as any).test = 0;\n },\n },\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n },\n);\n\nconst queryParsingSuite = new NiceBenchmark(\"Query parsing\");\nqueryParsingSuite.add(\"graphql-js\", async () => {\n parse(query);\n});\n\nconst queryCompilingSuite = new NiceBenchmark(\"Query compiling\");\nqueryCompilingSuite.add(\"graphql-jit\", async () => {\n await compileQuery(schema, parsedQuery);\n});\n\nconst queryAnnotationSuite = new NiceBenchmark(\"Query annotation\");\nqueryAnnotationSuite.add(\"supermassive\", () => {\n extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);\n});\n\nasync function main() {\n await queryCompilingSuite.run();\n await queryParsingSuite.run();\n await queryAnnotationSuite.run();\n await queryRunningSuite.run();\n}\n\nmain();\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,mBAAmB;AAC1B,OAAO,YAAY;AACnB,OAAO,eAAe;AACtB,OAAO,YAAY;AACnB;AAAA,EACE,WAAW;AAAA,EACX;AAAA,OAEK;AACP,SAAS,cAAc,uBAAuB;AAC9C,SAAS,wBAAwB,2BAA2B;AAE5D,SAAS,oDAAoD;AAE7D,IAAM,QAAQ,GAAG;AAAA,EACf,KAAK,KAAK,WAAW,2BAA2B;AAAA,EAChD;AAAA,IACE,UAAU;AAAA,EACZ;AACF;AAEA,IAAM,cAAc,MAAM,KAAK;AAC/B,IAAM,gBAAgB,aAAa,QAAQ,WAAW;AAEtD,IAAM,EAAE,YAAY,IAAI;AAAA,EACtB;AAAA,EACA;AACF;AAEA,IAAM,iBAAiC;AAAA,EACrC,UAAU;AAAA,EACV;AAAA,EACA;AACF;AAEA,IAAM,oBAAoB,IAAI,cAAc,eAAe;AAC3D,kBAAkB,IAAI,+BAA+B,YAAY;AAC/D,QAAM,SAAS,MAAM,eAAe;AAAA,IAClC;AAAA,IACA,UAAU,MAAM,KAAK;AAAA,IACrB,cAAc,EAAE,OAAO;AAAA,EACzB,CAAC;AACD,MAAI,OAAO,UAAU,CAAC,OAAO,MAAM;AACjC,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC;AACF,CAAC;AACD,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