Skip to content

Commit f3bd485

Browse files
committed
remove perf logging
1 parent 3625cfa commit f3bd485

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ export class DataSchemaCompiler {
221221
? files.filter(f => this.filesToCompile.includes(f.fileName))
222222
: files;
223223

224-
const jinjaLoaderTimer = perfTracker.start('loadJinjaTemplates');
225-
226224
const jinjaTemplatedFiles = toCompile.filter((file) => file.fileName.endsWith('.jinja') ||
227225
(file.fileName.endsWith('.yml') || file.fileName.endsWith('.yaml')) && file.content.match(JINJA_SYNTAX));
228226

@@ -231,8 +229,6 @@ export class DataSchemaCompiler {
231229
this.loadJinjaTemplates(jinjaTemplatedFiles);
232230
}
233231

234-
jinjaLoaderTimer.end();
235-
236232
const errorsReport = new ErrorReporter(null, [], this.errorReportOptions);
237233
this.errorsReporter = errorsReport;
238234

@@ -559,8 +555,6 @@ export class DataSchemaCompiler {
559555
): Promise<(FileContent | undefined)> {
560556
try {
561557
if (getEnv('transpilationNative')) {
562-
const compileJsFileTimer = perfTracker.start('transpileJsFile (native)');
563-
564558
const reqData = {
565559
fileName: file.fileName,
566560
fileContent: file.content,
@@ -582,12 +576,8 @@ export class DataSchemaCompiler {
582576
errorsReport.addWarnings(res[0].warnings as unknown as SyntaxErrorInterface[]);
583577
errorsReport.exitFile();
584578

585-
compileJsFileTimer.end();
586-
587579
return { ...file, content: res[0].code };
588580
} else if (getEnv('transpilationWorkerThreads')) {
589-
const compileJsFileTimer = perfTracker.start('transpileJsFile (threads)');
590-
591581
const data = {
592582
fileName: file.fileName,
593583
content: file.content,
@@ -600,12 +590,8 @@ export class DataSchemaCompiler {
600590
errorsReport.addErrors(res.errors);
601591
errorsReport.addWarnings(res.warnings);
602592

603-
compileJsFileTimer.end();
604-
605593
return { ...file, content: res.content };
606594
} else {
607-
const compileJsFileTimer = perfTracker.start('transpileJsFile (inplace)');
608-
609595
const ast = parse(
610596
file.content,
611597
{
@@ -623,8 +609,6 @@ export class DataSchemaCompiler {
623609

624610
const content = babelGenerator(ast, {}, file.content).code;
625611

626-
compileJsFileTimer.end();
627-
628612
return { ...file, content };
629613
}
630614
} catch (e: any) {
@@ -649,8 +633,6 @@ export class DataSchemaCompiler {
649633
{ cubeNames, cubeSymbols, compilerId }: TranspileOptions
650634
): Promise<(FileContent | undefined)> {
651635
if (getEnv('transpilationNative')) {
652-
const transpileYamlFileTimer = perfTracker.start('transpileYamlFile (native)');
653-
654636
const reqData = {
655637
fileName: file.fileName,
656638
fileContent: file.content,
@@ -667,12 +649,8 @@ export class DataSchemaCompiler {
667649
file.content = res[0].code;
668650
file.convertedToJs = true;
669651

670-
transpileYamlFileTimer.end();
671-
672652
return { ...file, content: res[0].code };
673653
} else if (getEnv('transpilationWorkerThreads')) {
674-
const transpileYamlFileTimer = perfTracker.start('transpileYamlFile (threads)');
675-
676654
const data = {
677655
fileName: file.fileName,
678656
content: file.content,
@@ -688,21 +666,15 @@ export class DataSchemaCompiler {
688666
file.content = res.content;
689667
file.convertedToJs = true;
690668

691-
transpileYamlFileTimer.end();
692-
693669
return { ...file, content: res.content };
694670
} else {
695-
const transpileYamlFileTimer = perfTracker.start('transpileYamlFile (inplace)');
696-
697671
const transpiledFile = this.yamlCompiler.transpileYamlFile(file, errorsReport);
698672

699673
if (transpiledFile) {
700674
file.content = transpiledFile.content;
701675
file.convertedToJs = true;
702676
}
703677

704-
transpileYamlFileTimer.end();
705-
706678
return transpiledFile;
707679
}
708680
}
@@ -712,8 +684,6 @@ export class DataSchemaCompiler {
712684
errorsReport: ErrorReporter,
713685
options: TranspileOptions
714686
): Promise<(FileContent | undefined)> {
715-
const transpileJinjaFileTimer = perfTracker.start('transpileJinjaFile (common)');
716-
717687
const renderedFile = await this.yamlCompiler.renderTemplate(
718688
file,
719689
this.standalone ? {} : this.cloneCompileContextWithGetterAlias(this.compileContext),
@@ -726,8 +696,6 @@ export class DataSchemaCompiler {
726696
// avoiding costly YAML/Python parsing again.
727697
file.content = renderedFile.content;
728698

729-
transpileJinjaFileTimer.end();
730-
731699
return this.transpileYamlFile(file, errorsReport, options);
732700
}
733701

@@ -784,9 +752,7 @@ export class DataSchemaCompiler {
784752
compiledFiles[file.fileName] = true;
785753

786754
if (file.convertedToJs) {
787-
const compileJsFileTimer = perfTracker.start('compileJsFile (convertedToJs)');
788755
this.compileJsFile(file, errorsReport);
789-
compileJsFileTimer.end();
790756
} else if (file.fileName.endsWith('.js')) {
791757
this.compileJsFile(file, errorsReport, { doSyntaxCheck });
792758
} else if (file.fileName.endsWith('.yml.jinja') || file.fileName.endsWith('.yaml.jinja') ||

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { nonStringFields } from './CubeValidator';
1919
import { ErrorReporter } from './ErrorReporter';
2020
import { camelizeCube } from './utils';
2121
import { CompileContext } from './DataSchemaCompiler';
22-
import { perfTracker } from './PerfTracker';
2322

2423
type EscapeStateStack = {
2524
inFormattedStr?: boolean;

0 commit comments

Comments
 (0)