Skip to content

Commit 35ff9c7

Browse files
committed
more perf trackers
1 parent 1900648 commit 35ff9c7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/cubejs-schema-compiler/src/compiler/YamlCompiler.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ export class YamlCompiler {
169169
if (propertyPath[propertyPath.length - 1] === 'values') {
170170
if (typeof code === 'string') {
171171
if (code.match(PY_TEMPLATE_SYNTAX)) {
172+
const parsePythonAndTranspileToJsTimer184 = perfTracker.start('parsePythonAndTranspileToJs call 184');
172173
ast = this.parsePythonAndTranspileToJs(`f"${this.escapeDoubleQuotes(code)}"`, errorsReport);
174+
parsePythonAndTranspileToJsTimer184.end();
173175
} else {
174176
ast = t.stringLiteral(code);
175177
}
@@ -184,7 +186,9 @@ export class YamlCompiler {
184186
}
185187
}
186188
if (ast === null) {
189+
const parsePythonAndTranspileToJsTimer201 = perfTracker.start('parsePythonAndTranspileToJs call 201');
187190
ast = this.parsePythonAndTranspileToJs(code, errorsReport);
191+
parsePythonAndTranspileToJsTimer201.end();
188192
}
189193
return this.extractProgramBodyIfNeeded(ast);
190194
}).filter(ast => !!ast)))]);
@@ -195,7 +199,9 @@ export class YamlCompiler {
195199
}
196200

197201
if (propertyPath[propertyPath.length - 1] === 'extends') {
202+
const parsePythonAndTranspileToJsTimer214 = perfTracker.start('parsePythonAndTranspileToJs call 214');
198203
const ast = this.parsePythonAndTranspileToJs(obj, errorsReport);
204+
parsePythonAndTranspileToJsTimer214.end();
199205
return this.astIntoArrowFunction(ast, obj, cubeName, name => this.cubeDictionary.resolveCube(name));
200206
} else if (typeof obj === 'string') {
201207
let code = obj;
@@ -204,7 +210,9 @@ export class YamlCompiler {
204210
code = `f"${this.escapeDoubleQuotes(obj)}"`;
205211
}
206212

213+
const parsePythonAndTranspileToJsTimer225 = perfTracker.start('parsePythonAndTranspileToJs call 225');
207214
const ast = this.parsePythonAndTranspileToJs(code, errorsReport);
215+
parsePythonAndTranspileToJsTimer225.end();
208216
return this.extractProgramBodyIfNeeded(ast);
209217
} else if (typeof obj === 'boolean') {
210218
return t.booleanLiteral(obj);
@@ -282,7 +290,9 @@ export class YamlCompiler {
282290
}
283291

284292
private parsePythonIntoArrowFunction(codeString: string, cubeName, originalObj, errorsReport: ErrorReporter) {
293+
const parsePythonAndTranspileToJsTimer301 = perfTracker.start('parsePythonAndTranspileToJs call 301');
285294
const ast = this.parsePythonAndTranspileToJs(codeString, errorsReport);
295+
parsePythonAndTranspileToJsTimer301.end();
286296
return this.astIntoArrowFunction(ast as any, codeString, cubeName);
287297
}
288298

0 commit comments

Comments
 (0)