Skip to content

Commit f3bba68

Browse files
committed
remove perf logging
1 parent 343afc5 commit f3bba68

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

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

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { CompilerInterface } from './PrepareCompiler';
2323
import { YamlCompiler } from './YamlCompiler';
2424
import { CubeDictionary } from './CubeDictionary';
2525
import { CompilerCache } from './CompilerCache';
26-
import { perfTracker } from './PerfTracker';
2726

2827
const ctxFileStorage = new AsyncLocalStorage<FileContent>();
2928

@@ -215,9 +214,6 @@ export class DataSchemaCompiler {
215214
protected async doCompile() {
216215
const files = await this.repository.dataSchemaFiles();
217216

218-
console.log(`Compiling ${files.length} files...`);
219-
const compileTimer = perfTracker.start('doCompile', true);
220-
221217
this.pythonContext = await this.loadPythonContext(files, 'globals.py');
222218
this.yamlCompiler.initFromPythonContext(this.pythonContext);
223219

@@ -250,8 +246,6 @@ export class DataSchemaCompiler {
250246
}
251247

252248
const transpile = async (stage: CompileStage): Promise<FileContent[]> => {
253-
const transpileTimer = perfTracker.start(`transpilation-stage-${stage}`);
254-
255249
let cubeNames: string[] = [];
256250
let cubeSymbols: Record<string, Record<string, boolean>> = {};
257251
let transpilerNames: string[] = [];
@@ -318,8 +312,6 @@ export class DataSchemaCompiler {
318312
results = await Promise.all(toCompile.map(f => this.transpileFile(f, errorsReport, {})));
319313
}
320314

321-
transpileTimer.end();
322-
323315
return results.filter(f => !!f) as FileContent[];
324316
};
325317

@@ -416,8 +408,6 @@ export class DataSchemaCompiler {
416408
});
417409

418410
const compilePhase = async (compilers: CompileCubeFilesCompilers, stage: 0 | 1 | 2 | 3) => {
419-
const compilePhaseTimer = perfTracker.start(`compilation-phase-${stage}`);
420-
421411
// clear the objects for the next phase
422412
cubes = [];
423413
exports = {};
@@ -426,9 +416,7 @@ export class DataSchemaCompiler {
426416
asyncModules = [];
427417
transpiledFiles = await transpile(stage);
428418

429-
const res = this.compileCubeFiles(cubes, contexts, compiledFiles, asyncModules, compilers, transpiledFiles, errorsReport);
430-
compilePhaseTimer.end();
431-
return res;
419+
return this.compileCubeFiles(cubes, contexts, compiledFiles, asyncModules, compilers, transpiledFiles, errorsReport);
432420
};
433421

434422
return compilePhase({ cubeCompilers: this.cubeNameCompilers }, 0)
@@ -464,12 +452,6 @@ export class DataSchemaCompiler {
464452
} else if (transpilationWorkerThreads && this.workerPool) {
465453
this.workerPool.terminate();
466454
}
467-
468-
// End overall compilation timing and print performance report
469-
compileTimer.end();
470-
setImmediate(() => {
471-
perfTracker.printReport();
472-
});
473455
});
474456
}
475457

@@ -500,7 +482,6 @@ export class DataSchemaCompiler {
500482

501483
const jinjaEngine = this.yamlCompiler.getJinjaEngine();
502484

503-
// XXX: Make this as bulk operation in the native side
504485
files.forEach((file) => {
505486
jinjaEngine.loadTemplate(file.fileName, file.content);
506487
});
@@ -534,8 +515,6 @@ export class DataSchemaCompiler {
534515
errorsReport: ErrorReporter,
535516
{ cubeNames, cubeSymbols, contextSymbols, transpilerNames, compilerId, stage }: TranspileOptions
536517
): Promise<(FileContent | undefined)[]> {
537-
const compileJsFileTimer = perfTracker.start('transpileJsFilesBulk (native)');
538-
539518
// for bulk processing this data may be optimized even more by passing transpilerNames, compilerId only once for a bulk
540519
// but this requires more complex logic to be implemented in the native side.
541520
// And comparing to the file content sizes, a few bytes of JSON data is not a big deal here
@@ -555,8 +534,6 @@ export class DataSchemaCompiler {
555534
}));
556535
const res = await transpileJs(reqDataArr);
557536

558-
compileJsFileTimer.end();
559-
560537
return files.map((file, index) => {
561538
errorsReport.inFile(file);
562539
if (!res[index]) { // This should not happen in theory but just to be safe
@@ -766,26 +743,18 @@ export class DataSchemaCompiler {
766743
compiledFiles[file.fileName] = true;
767744

768745
if (file.convertedToJs) {
769-
const compileJsFileTimer = perfTracker.start('compileJsFile (convertedToJs)');
770746
this.compileJsFile(file, errorsReport);
771-
compileJsFileTimer.end();
772747
} else if (file.fileName.endsWith('.js')) {
773-
const compileJsFileTimer = perfTracker.start('compileJsFile');
774748
this.compileJsFile(file, errorsReport, { doSyntaxCheck });
775-
compileJsFileTimer.end();
776749
} else if (file.fileName.endsWith('.yml.jinja') || file.fileName.endsWith('.yaml.jinja') ||
777750
(file.fileName.endsWith('.yml') || file.fileName.endsWith('.yaml')) &&
778751
file.content.match(JINJA_SYNTAX)
779752
) {
780-
const compileJinjaFileTimer = perfTracker.start('compileJinjaFile (actually js)');
781753
// original jinja/yaml file was already transpiled into js
782754
this.compileJsFile(file, errorsReport);
783-
compileJinjaFileTimer.end();
784755
} else if (file.fileName.endsWith('.yml') || file.fileName.endsWith('.yaml')) {
785-
const compileYamlFileTimer = perfTracker.start('compileYamlFile (actually js)');
786756
// original yaml file was already transpiled into js
787757
this.compileJsFile(file, errorsReport);
788-
compileYamlFileTimer.end();
789758
}
790759
}
791760

0 commit comments

Comments
 (0)