@@ -16,7 +16,6 @@ import { nonStringFields } from './CubeValidator';
1616import  {  CubeDictionary  }  from  './CubeDictionary' ; 
1717import  {  ErrorReporter  }  from  './ErrorReporter' ; 
1818import  {  camelizeCube  }  from  './utils' ; 
19- import  {  perfTracker  }  from  './PerfTracker' ; 
2019
2120type  EscapeStateStack  =  { 
2221  inFormattedStr ?: boolean ; 
@@ -93,9 +92,7 @@ export class YamlCompiler {
9392    for  ( const  key  of  Object . keys ( yamlObj ) )  { 
9493      if  ( key  ===  'cubes' )  { 
9594        ( yamlObj . cubes  ||  [ ] ) . forEach ( ( {  name,  ...cube  } )  =>  { 
96-           const  transpileAndPrepareJsFileTimer  =  perfTracker . start ( 'yaml-transpileAndPrepareJsFile' ) ; 
9795          const  transpiledFile  =  this . transpileAndPrepareJsFile ( file ,  'cube' ,  {  name,  ...cube  } ,  errorsReport ) ; 
98-           transpileAndPrepareJsFileTimer . end ( ) ; 
9996          this . dataSchemaCompiler ?. compileJsFile ( transpiledFile ,  errorsReport ) ; 
10097        } ) ; 
10198      }  else  if  ( key  ===  'views' )  { 
@@ -137,10 +134,7 @@ export class YamlCompiler {
137134
138135    cubeObj . hierarchies  =  this . yamlArrayToObj ( cubeObj . hierarchies  ||  [ ] ,  'hierarchies' ,  errorsReport ) ; 
139136
140-     const  transpileYamlTimer  =  perfTracker . start ( 'transpileYaml' ) ; 
141-     const  res  =  this . transpileYaml ( cubeObj ,  [ ] ,  cubeObj . name ,  errorsReport ) ; 
142-     transpileYamlTimer . end ( ) ; 
143-     return  res ; 
137+     return  this . transpileYaml ( cubeObj ,  [ ] ,  cubeObj . name ,  errorsReport ) ; 
144138  } 
145139
146140  private  transpileYaml ( obj ,  propertyPath ,  cubeName ,  errorsReport : ErrorReporter )  { 
@@ -169,9 +163,7 @@ export class YamlCompiler {
169163              if  ( propertyPath [ propertyPath . length  -  1 ]  ===  'values' )  { 
170164                if  ( typeof  code  ===  'string' )  { 
171165                  if  ( code . match ( PY_TEMPLATE_SYNTAX ) )  { 
172-                     const  parsePythonAndTranspileToJsTimer184  =  perfTracker . start ( 'parsePythonAndTranspileToJs call 184' ) ; 
173166                    ast  =  this . parsePythonAndTranspileToJs ( `f"${ this . escapeDoubleQuotes ( code ) }  "` ,  errorsReport ) ; 
174-                     parsePythonAndTranspileToJsTimer184 . end ( ) ; 
175167                  }  else  { 
176168                    ast  =  t . stringLiteral ( code ) ; 
177169                  } 
@@ -186,9 +178,7 @@ export class YamlCompiler {
186178                } 
187179              } 
188180              if  ( ast  ===  null )  { 
189-                 const  parsePythonAndTranspileToJsTimer201  =  perfTracker . start ( 'parsePythonAndTranspileToJs call 201' ) ; 
190181                ast  =  this . parsePythonAndTranspileToJs ( code ,  errorsReport ) ; 
191-                 parsePythonAndTranspileToJsTimer201 . end ( ) ; 
192182              } 
193183              return  this . extractProgramBodyIfNeeded ( ast ) ; 
194184            } ) . filter ( ast  =>  ! ! ast ) ) ) ] ) ; 
@@ -199,9 +189,7 @@ export class YamlCompiler {
199189    } 
200190
201191    if  ( propertyPath [ propertyPath . length  -  1 ]  ===  'extends' )  { 
202-       const  parsePythonAndTranspileToJsTimer214  =  perfTracker . start ( 'parsePythonAndTranspileToJs call 214' ) ; 
203192      const  ast  =  this . parsePythonAndTranspileToJs ( obj ,  errorsReport ) ; 
204-       parsePythonAndTranspileToJsTimer214 . end ( ) ; 
205193      return  this . astIntoArrowFunction ( ast ,  obj ,  cubeName ,  name  =>  this . cubeDictionary . resolveCube ( name ) ) ; 
206194    }  else  if  ( typeof  obj  ===  'string' )  { 
207195      let  code  =  obj ; 
@@ -215,9 +203,7 @@ export class YamlCompiler {
215203          code  =  `f"${ this . escapeDoubleQuotes ( obj ) }  "` ; 
216204        } 
217205
218-         const  parsePythonAndTranspileToJsTimer225  =  perfTracker . start ( 'parsePythonAndTranspileToJs call 225' ) ; 
219206        const  ast  =  this . parsePythonAndTranspileToJs ( code ,  errorsReport ) ; 
220-         parsePythonAndTranspileToJsTimer225 . end ( ) ; 
221207        return  this . extractProgramBodyIfNeeded ( ast ) ; 
222208      } 
223209
@@ -302,9 +288,7 @@ export class YamlCompiler {
302288  } 
303289
304290  private  parsePythonIntoArrowFunction ( codeString : string ,  cubeName ,  originalObj ,  errorsReport : ErrorReporter )  { 
305-     const  parsePythonAndTranspileToJsTimer301  =  perfTracker . start ( 'parsePythonAndTranspileToJs call 301' ) ; 
306291    const  ast  =  this . parsePythonAndTranspileToJs ( codeString ,  errorsReport ) ; 
307-     parsePythonAndTranspileToJsTimer301 . end ( ) ; 
308292    return  this . astIntoArrowFunction ( ast  as  any ,  codeString ,  cubeName ) ; 
309293  } 
310294
@@ -314,12 +298,8 @@ export class YamlCompiler {
314298    } 
315299
316300    try  { 
317-       const  parsePythonAndTranspileToJsTimer  =  perfTracker . start ( 'PythonParser->transpileToJs()' ) ; 
318- 
319301      const  pythonParser  =  new  PythonParser ( codeString ) ; 
320-       const  res  =  pythonParser . transpileToJs ( ) ; 
321-       parsePythonAndTranspileToJsTimer . end ( ) ; 
322-       return  res ; 
302+       return  pythonParser . transpileToJs ( ) ; 
323303    }  catch  ( e : any )  { 
324304      errorsReport . error ( `Can't parse python expression. Most likely this type of syntax isn't supported yet: ${ e . message  ||  e }  ` ) ; 
325305    } 
@@ -328,7 +308,6 @@ export class YamlCompiler {
328308  } 
329309
330310  private  astIntoArrowFunction ( input : t . Program  |  t . NullLiteral ,  codeString : string ,  cubeName ,  resolveSymbol ?: ( string )  =>  any)  { 
331-     const  astIntoArrowFunctionTimer  =  perfTracker . start ( 'astIntoArrowFunction' ) ; 
332311    const  initialJs  =  babelGenerator ( input ,  { } ,  codeString ) . code ; 
333312
334313    // Re-parse generated JS to set all necessary parent paths 
@@ -353,7 +332,6 @@ export class YamlCompiler {
353332    babelTraverse ( ast ,  traverseObj ) ; 
354333
355334    const  body : any  =  ast . program . body [ 0 ] ; 
356-     astIntoArrowFunctionTimer . end ( ) ; 
357335    return  body ?. expression ; 
358336  } 
359337
0 commit comments