Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 50eee10

Browse files
committed
chore(compiler): update benchmark script
1 parent 7a071a9 commit 50eee10

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

compiler/benchmark.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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';
22
import { colors, path, Sha1, walk } from '../deps.ts';
33
import { initWasm, transpileSync } from './mod.ts';
44

@@ -41,10 +41,10 @@ async function benchmark(sourceFiles: Array<{ code: string, filename: string }>,
4141
const d1 = { d: 0, min: 0, max: 0, }
4242
for (const { code, filename } of sourceFiles) {
4343
const t = performance.now()
44-
for (let i = 0; i < 2; i++) {
44+
for (let i = 0; i < 5; i++) {
4545
tsc(code, { filename, isDev })
4646
}
47-
const d = (performance.now() - t) / 2
47+
const d = (performance.now() - t) / 5
4848
if (d1.min === 0 || d < d1.min) {
4949
d1.min = d
5050
}
@@ -57,10 +57,10 @@ async function benchmark(sourceFiles: Array<{ code: string, filename: string }>,
5757
const d2 = { d: 0, min: 0, max: 0, }
5858
for (const { code, filename } of sourceFiles) {
5959
const t = performance.now()
60-
for (let i = 0; i < 2; i++) {
60+
for (let i = 0; i < 5; i++) {
6161
transpileSync(code, { url: filename, swcOptions: {}, isDev })
6262
}
63-
const d = (performance.now() - t) / 2
63+
const d = (performance.now() - t) / 5
6464
if (d2.min === 0 || d < d2.min) {
6565
d2.min = d
6666
}
@@ -90,7 +90,7 @@ if (import.meta.main) {
9090
sourceFiles.push({ code: await Deno.readTextFile(filename), filename })
9191
}
9292

93-
benchmark(sourceFiles, false)
94-
benchmark(sourceFiles, true)
93+
await benchmark(sourceFiles, true)
94+
await benchmark(sourceFiles, false)
9595
})()
9696
}

0 commit comments

Comments
 (0)