diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16ec63b9f..95e7540f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -184,7 +184,34 @@ jobs: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v1 - run: bun install - - run: bun type-check-perf/generate-app.ts - - run: bun tsc -p type-check-perf/tsconfig.json --diagnostics + - run: bun generate-app.ts + working-directory: type-check-perf + - run: | + { + echo 'DIAGNOSTICS<> "$GITHUB_ENV" + working-directory: type-check-perf + post-type-check-perf-on-pr: + runs-on: ubuntu-latest + needs: type-check-perf-monitoring + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + - run: bun install + - run: echo -e $DIAGNOSTICS > current.txt + - run: | + { + echo 'COMPARISON<> "$GITHUB_ENV" + working-directory: type-check-perf + - uses: thollander/actions-comment-pull-request@v2 + with: + comment_tag: type-check-perf + message: ${{ env.COMPARISON }} \ No newline at end of file diff --git a/README.md b/README.md index 122ba439d..133f7869f 100644 --- a/README.md +++ b/README.md @@ -89,3 +89,20 @@ _RegExpRouter_, _SmartRouter_, _LinearRouter_, and _PatternRouter_ are created b ## License Distributed under the MIT License. See [LICENSE](LICENSE) for more information. + +| Metrics | Current | Previous() | +|---|---|---| +| Files | 247 | 247 | +| Lines | 113520 | 113520 | +| Identifiers | 110226 | 110226 | +| Symbols | 256205 | 256205 | +| Types | 214588 | 214588 | +| **Instantiations** | 3438524 | 3438524 | +| Memory used | 467326K | 463038K | +| I/O read | 0.02s | 0.02s | +| I/O write | 0.00s | 0.00s | +| Parse time | 0.39s | 0.44s | +| Bind time | 0.16s | 0.16s | +| Check time | 5.45s | 5.38s | +| Emit time | 0.00s | 0.00s | +| Total time | 6.00s | 5.97s | diff --git a/type-check-perf/process-results.ts b/type-check-perf/process-results.ts new file mode 100644 index 000000000..5b0ea65ad --- /dev/null +++ b/type-check-perf/process-results.ts @@ -0,0 +1,19 @@ +import * as fs from 'node:fs/promises' + +async function main() { + const currentResult = (await fs.readFile('./result.txt')).toString().split('\n') + const previousResult = await fs.readFile('./main-result.txt') + .then((data) => data.toString().split('\n')) + .catch(() => null) + // currentResultとpreviousResultを結合してmarkdownのテーブルを作る + const table = ['| Metrics | Current | Previous |', '|---|---|---|'] + for (const [i, line] of currentResult.entries()) { + if (line === '') continue; + const [name, value] = line.split(':') + const mainValue = previousResult?.[i]?.split(':')?.[1] + table.push(`| ${name?.trim()} | ${value?.trim()} | ${mainValue ? mainValue.trim() : 'N/A'} |`) + } + console.log(table.join('\n')) +} + +main() diff --git a/type-check-perf/tsconfig.json b/type-check-perf/tsconfig.json index 338aea486..85f8566b7 100644 --- a/type-check-perf/tsconfig.json +++ b/type-check-perf/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "module": "esnext", "noEmit": true, - "rootDir": ".." + "rootDir": "..", + "strict": true }, "include": [ "**/*.ts",