Skip to content

Commit 7d49c5d

Browse files
committed
breaking: refactor benchmark logic
1 parent cbd917f commit 7d49c5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+228
-681
lines changed

.github/workflows/benchmark.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ on:
33
push:
44
branches:
55
- main
6-
6+
paths:
7+
- 'src/**'
8+
- 'reports/**'
79
env:
810
NODE_VERSION: 20.16.0
911
PNPM_VERSION: 9.14.2
@@ -25,7 +27,7 @@ permissions:
2527
jobs:
2628
evaluate:
2729
name: Evaluate
28-
runs-on: ubuntu-latest
30+
runs-on: ubuntu-22.04
2931

3032
timeout-minutes: 20
3133

@@ -57,10 +59,19 @@ jobs:
5759
- name: Install dependencies
5860
run: pnpm install --frozen-lockfile
5961

62+
- name: Run evaluate
63+
run: pnpm run:codegen
64+
6065
- name: Run evaluate
6166
run: pnpm run:evaluate
6267

68+
- name: Prepare venv
69+
run: pnpm prepare:venv
70+
71+
- name: Run generate report
72+
run: pnpm run:report
73+
6374
- name: Upload results
6475
uses: stefanzweifel/git-auto-commit-action@v4
6576
with:
66-
commit_message: update __benchmark__ results
77+
commit_message: update __benchmark__ and __assets__ results

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
trace.json
33
types.json
4-
venv
4+
.venv
5+
__pycache__

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,30 @@ This repository aims to provide a benchmark of CPU and RAM usage during Typescri
44

55
# Table of Contents <!-- omit in toc -->
66

7+
- [Environment](#environment)
78
- [Data Preparation](#data-preparation)
89
- [Benchmark](#benchmark)
910
- [Summary](#summary)
1011
- [Add more data or candidates](#add-more-data-or-candidates)
1112
- [Run the benchmark yourself](#run-the-benchmark-yourself)
1213

14+
# Environment
15+
16+
- **OS**: ubuntu-22.04 vCPU 4 | RAM 16GB (via Github Action)
17+
- **Node.js**: 20.16.0
18+
- **Bun** 1.1.10
19+
- **Pnpm** 9.14.2
20+
- **Python** 3.13.0
21+
22+
| Library | Version |
23+
| -------------- | ------------ |
24+
| zod | 0.67.13 |
25+
| typebox | 0.32.31 |
26+
| arktype | 2.0.0-dev.16 |
27+
| valibot | 0.31.0-rc.5 |
28+
| yup | 1.4.0 |
29+
| @effect/schema | 0.13.1 |
30+
1331
# Data Preparation
1432

1533
TODO

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,30 @@
55
"type": "module",
66
"main": "index.js",
77
"scripts": {
8+
"prepare:venv": "python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt",
89
"run:codegen": "bun ./src/cli/codegen.ts",
9-
"run:evaluate": "bun ./src/cli/evaluate.ts"
10+
"run:evaluate": "bun ./src/cli/evaluate.ts",
11+
"run:report": "source .venv/bin/activate && python3 reports/main.py"
1012
},
1113
"keywords": [],
1214
"author": "",
1315
"license": "ISC",
1416
"dependencies": {
15-
"@effect/schema": "^0.67.13",
16-
"@sinclair/typebox": "^0.32.31",
17+
"@effect/schema": "^0.75.5",
18+
"@sinclair/typebox": "^0.34.13",
1719
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
1820
"@typescript-eslint/typescript-estree": "^7.10.0",
19-
"arktype": "2.0.0-dev.16",
20-
"io-ts": "^2.2.21",
21+
"arktype": "2.0.0-rc.33",
22+
"io-ts": "^2.2.22",
2123
"prettier": "^3.2.5",
2224
"typescript": "^5.4.5",
23-
"valibot": "0.31.0-rc.5",
24-
"yup": "^1.4.0",
25-
"zod": "^3.23.8"
25+
"valibot": "1.0.0-beta.11",
26+
"yup": "^1.6.1",
27+
"zod": "^3.24.1"
2628
},
2729
"devDependencies": {
2830
"@types/node": "^20.12.12",
2931
"@types/prettier": "^3.0.0"
30-
}
32+
},
33+
"packageManager": "pnpm@9.14.2"
3134
}

pnpm-lock.yaml

Lines changed: 57 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reports/__assets__/Check time.png

55.9 KB
Loading

reports/__assets__/Memory used.png

60.4 KB
Loading
56.2 KB
Loading

reports/__assets__/Total time.png

55.2 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)