1
- import { compile , CompileOptions } from 'https://deno.land/x/[email protected] .27 /tsc/compile.ts' ;
1
+ import { compile , CompileOptions } from 'https://deno.land/x/[email protected] .28 /tsc/compile.ts' ;
2
2
import { colors , path , Sha1 , walk } from '../deps.ts' ;
3
3
import { initWasm , transpileSync } from './mod.ts' ;
4
4
@@ -41,10 +41,10 @@ async function benchmark(sourceFiles: Array<{ code: string, filename: string }>,
41
41
const d1 = { d : 0 , min : 0 , max : 0 , }
42
42
for ( const { code, filename } of sourceFiles ) {
43
43
const t = performance . now ( )
44
- for ( let i = 0 ; i < 2 ; i ++ ) {
44
+ for ( let i = 0 ; i < 5 ; i ++ ) {
45
45
tsc ( code , { filename, isDev } )
46
46
}
47
- const d = ( performance . now ( ) - t ) / 2
47
+ const d = ( performance . now ( ) - t ) / 5
48
48
if ( d1 . min === 0 || d < d1 . min ) {
49
49
d1 . min = d
50
50
}
@@ -57,10 +57,10 @@ async function benchmark(sourceFiles: Array<{ code: string, filename: string }>,
57
57
const d2 = { d : 0 , min : 0 , max : 0 , }
58
58
for ( const { code, filename } of sourceFiles ) {
59
59
const t = performance . now ( )
60
- for ( let i = 0 ; i < 2 ; i ++ ) {
60
+ for ( let i = 0 ; i < 5 ; i ++ ) {
61
61
transpileSync ( code , { url : filename , swcOptions : { } , isDev } )
62
62
}
63
- const d = ( performance . now ( ) - t ) / 2
63
+ const d = ( performance . now ( ) - t ) / 5
64
64
if ( d2 . min === 0 || d < d2 . min ) {
65
65
d2 . min = d
66
66
}
@@ -90,7 +90,7 @@ if (import.meta.main) {
90
90
sourceFiles . push ( { code : await Deno . readTextFile ( filename ) , filename } )
91
91
}
92
92
93
- benchmark ( sourceFiles , false )
94
- benchmark ( sourceFiles , true )
93
+ await benchmark ( sourceFiles , true )
94
+ await benchmark ( sourceFiles , false )
95
95
} ) ( )
96
96
}
0 commit comments